Well I noticed it looks like your abandoned the the Platformer behaviour. Possible becuase you need too for some of Sonics abilities. But doing so puts a lot more stress on your cpu code.
You should figure another way to cut out the WHILE loop in movment and try to only run it once per tick. I haven't sit down to see how many times per tick it will run. But I can imagaine that it's running a few hundred times. And is likely the reason it accounts for %16.
Also I noticed you call Player.Repo and Collision with both on Evertick.
you should run a single every tick and put them in order once. As it looks now If assuming these are running in order.
Position/Collision
Movement while loop
position/Collision
ok. se thats the supposed run order. Now imagine 3 ticks of that
Position/Collision
Movement while loop with position/Collision
position/Collision
-
Position/Collision
Movement while loop with position/Collision
position/Collision
-
Position/Collision
Movement while loop with position/Collision
position/Collision
notice how poosition/collision call functions are right after each other. Is that really needed?
now I did some testing. You can disable the entire post-move and have no negative gameplay effect i noticed. And this saved apx 8%
I then tried leaving the post animation on and turned all the other collision and position checks prior tot he post and managed to get the the group from 36% to 16%. However this comes with that the animation starts going off. Character doesn't rotate as smoothly. There is some room for improvement :)