#Animatable Body 2D- Player sliding after landing if accelerating/decelerating horizontally

7 messages · Page 1 of 1 (latest)

sage jay
#

Bumping

flat hatch
#

you could try changing the platform to a CharacterBody2D and see if that fixes it

sage jay
#

Hm, interesting idea. I'll try that in the next couple days

sage jay
#

Sorry just got around to it. Nope it still happens with a characterbody2d

#

I think the problem is that the platform is adding momentum to the player based on its current speed, but if it's slowing down, then the momentum from the previous speed is still being applied, causing the player to "slide". This wouldn't be an issue if the platformer wasn't momentum based. Because it is momentum based, speed is kept from tick to tick and slowly brought to 0 if no joystick motion is applied

#

So maybe, if the platform is slowing down, I need to find the difference between its previous speed and its current speed and subtract that difference from the player's speed?

sage jay
#

Tried doing this for a while and while it seems like it maybe mitigates the effects a little it doesn't perfectly solve them