RigidBody2D stuck on a StaticBody2D (both are using a RectangleShape2D)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Siedler
:warning: Old Version Published before Godot 3 was released.

Hey,

I have a weird issue where my rigid body get stuck while moving over a static body. I have developed a little application wich will demonstrate this issue:

Some little explanations how to reproduce the issue:

Move over the ground with the a and d buttons. After some time the rigid body (player) gets stuck on a static body (this also happens in the corner of the level). If you get stuck and want to proceed with testing just press space to jump.

:bust_in_silhouette: Reply From: eons

The problem happens in every physics api when you have a rectangle rigid and many rectangle static bodies, the rigid will get stuck in the impossible to see separation between statics…

The solution normally is to use a Capsule instead a Rectangle, it wont work always as intended (here, with Unity, with Unreal, Box, Nape, etc.), the borders between statics can make a capsule jump also can get stuck if not lucky.

Rigids are unpredictable, you have the option to use custom integrators too and get a bit more control over it (like the old platformer demo).

Thank you!!!

Too bad that this is an issue. But I figured out that the things that I want are also possible with a KinematicBody2D. The only thing that will miss is the calculated rotation that the RigidBody2D did for me.

Anyway, thank you again ^^

Siedler | 2016-10-17 19:58

I think only one big engine recommend use of rigids for characters.

Godot has a lot of tools to do it too (as shown in the platformer demo) and the mode changes allows the character to go ballistic if need it, but the full and simple control over kinematics tends to be the best option.

eons | 2016-10-18 17:03