Snag at base of slope in platformer

I’m trying to use angled slopes in a platformer, but the player character briefly snags on the bottom of the slope when they are walking from one platform to another.

The easiest way to see an example of this is to load up the default platform project (tutorial with the alien), rotate one of the blocks next to player spawn at a 45 degree angle and try to walk up it.

Slope max angle is set to 60 by default and the character does walk up the ramp, but you will notice it briefly snags at the bottom. The collision box is default.

I’ve noticed that the example game ‘not a vania’ was able to have smooth transitions on their slopes with no snagging, and this didn’t change if I adjusted the angle of the slope. The collision box there is rectangular and it uses the same platformer physics as the other project. So I’m wondering what the difference is?

Hello!

This is due to how acceleration/deceleration is currently handled in the engine. This is partially because the engine detects leaving one platform and going to another. I solved this in Not-a-vania by ensuring all of the platform objects fully overlap, but it is a very particular process.

Luckily, this is being remedied in the new platformer collision logic. A beta is out for this right now here: Release 5.0.122-beta1 · 4ian/GDevelop · GitHub

You can give it a shot and see if it solves your issue. Just make sure you backup your project beforehand.

Okay I’ve thought of a work around which is acceptable but has a down side.

I’ve added a timer for the transition between run and idle animation of 0.1 seconds which is long enough to bypass the stutter in graphics. BUT your player will still decelerate when they hit the top and bottom of the slope.

In testing I reduced the acceleration of the character in not a vania to 150 and found that it does indeed snag. but because the default acceleration is so high it is un-noticeable.

So for the work around to work you need to use a timer delay AND have large acceleration, a shame if you wanted lower acceleration. There goes my ice level…

Great the new build fixed it! Thanks very much @Silver-Streak

1 Like

I’m trying to use angled slopes in a platformer, but the player character briefly snags on the bottom of the slope when they are walking … As the player moves, remember that he is on the ground. Adjust along the slope unblocked slope horizontally then snap the player back onto the ground afterward. The player has reached the top of the slope. This involves adding an extra case to the end of our "is the player intersecting a slope " algorithm. · The player …