#physics works wrong

1 messages · Page 1 of 1 (latest)

somber rose
#

You probably should be setting velocity.x to your normal walking speed or similar while jumping, otherwise it'll get set to zero and stay zero the instant you hit a vertical surface.

#

(you'll need to set the horizontal speed every physics step if you want it to keep moving in a direction even if it hits something)

#

Oh, I misread the problem. I thought you wanted to be able to jump through the gap.

#

One problem with Godot's 2D physics is that it has a bit of a buffer zone around all your shapes, and that means that shape will sometimes hit each other when you think they shouldn't.

#

I think it's controlled by the safe_margin property.

#

But it might be difficult to completely eliminate it.

#

In my platformer, I gave the player a non-square collision shape and that helped with a lot of weird collision behaviour.

#

Maybe bevelling the top corners would help in your case.

#

You might not want a round-bottomed character in your case because you'll probably slip off corners.

#

Try making a custom polygon instead.