Unity 2D Course Tilevania - Issue with slopes

Hello all!! I’m doing quite a bit of fine tuning on the project, way beyond the scope of the course, and I’ve run into some tricky issues with slopes. As you can see in the gif below, I’m using stairs with the custom physics set to a slope. When ascending the stairs, I have 3 issues.

  1. The character picks up upward momentum, and when jumping gets some serious air (Great for a future action sports game though!)

  2. Even when walking up the stairs, the character still has enough momentum to get a little hop at the top.

  3. Stopping on the stairs caused the character to slide back down.

ezgif.com-gif-maker

I’ve already put the slopes on a different tilemap/layer to resolve some bugs with shooting arrows, but these issues are still plaguing me.

Thanks in advance for any help!!

Hi,

It’s great to see that you are implementing your own solutions. To be honest, I like that little jump at the end of the slope. It makes the movement more interesting.

However, if you do not like that, you could try to increase the drag value in the player’s Rigidbody2D component. Maybe that’ll fix the jump.

If the issue persists, check the code that makes the player move upstairs. Maybe it increases the velocity? Without knowing anything about your project (apart from the gif), it is impossible for me to tell what might have gone “wrong” and how to fix it.

The sliding very likely happens due to the gravity. If you completed the TileVania section, you could try to apply Rick’s solution for the sliding on the ladder.

I hope this helped a bit. :slight_smile:


See also:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms