CharacterBody2D gets stuck on a wall (StaticBody2D)

Godot Version

v4.2.1

Question

I’m experimenting some 2D side scrolling physics. I’m pretty novice on Godot and some experience on Unity before.

The red box is the controllable player. It’s a CharacterBody2D node . The walls are StaticBody2D. I enabled the Collisionshapes visible. Velocity is also added on the video.

When I jump into the wall, it stucks there. It doesn’t fall down and it keeps adding velocity due to gravity.

I’m changing the scale of CharacterBody2D which also changes the scale of the collision shape. Would that be a reason?

I found the problem. The box was slightly rotated (around 1 degree), which created a corner point somewhere around the edges and the box just stuck on the wall because I guess that’s how the engine works. But because how I wrote the code, the box also thinks that it’s falling down.

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