Having an issue with slopes in a 2D platformer


#1

So I’m starting to make a 2D platfomer and I’ve hit a bit of a snag.

When the player character runs up a slope it’s slightly staggered at the beginning of each tile, but when it runs down a slope it’s perfectly smooth.

For reference I’m currently using the default Platformer behaviours for the floors and character.


#2

Could you make a video of what you mean exactly?


#3

Sure, here’s a video of it (make sure to select 1080p60) https://youtu.be/vbDqh67PhfY


#4

Imo it is a very slight stagger, barely noticeable. Looks quite realistic in a sense when you go up a steep gradient you will slow down for a moment as you adjust. Not sure what it is exactly but wild guess, it might have something to do with the scene properties gravity?


#5

why don’t you make it one piece?
or maybe if you aren’t assign a hitbox to the slope tiles, but add a hidden obstacle. one simple appropriate size recrangle, rotated to the appropriate angle?


#6

in my opinion it is caused by the hitbox, not the gravity.


#7

hitbox is first thing that crossed my mind too… my characters do behave in odd ways if the hitbox isn’t right


#8

I’m just guessing too.in my project I notice the same thing, but I use slopes as slopes only. so the player can move only down on it. so it’s good for me anyway.


#9

I’ve tried this and it’s mostly fixed the issue. It seems to be a hitbox issue along with the acceleration of the character. I’ll have a play around with things until I get it looking right. Thanks for everybody’s assistance!


#10

if you figure out something useful, please tell us.