How can i decide to bodies? Rigid Kinematic or Static?

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

Hi,
Which node for what? For charachter, wall, enemy etc.
RigidBody for what?
KinematicBody for what?
StaticBody for what?

Looks like we can use rigidbody or kinematicbody for the character but which one is true?

:bust_in_silhouette: Reply From: DodoIta

StaticBody is ideal for walls and ground, since it doesn’t react to physics (it’s static). It takes part in collision detection though (other nodes can collide with it).

For the character you can use both KinematicBody and RigidBody, the choice depends on what you need:
RigidBody is the most advanced node, it’s meant to simulate Newtonian physics and it has a lot of properties.
KinematicBody is a bit simpler in my opinion, you can move it via the move function or by animating it.

Actually, I’ve seen people using Area2D nodes to move characters, so it’s really a matter of taste other than needs.
Source

Thanks! My years-long confusion has been terminated!

Ingeniou5 | 2022-05-01 20:28

:bust_in_silhouette: Reply From: eons

For characters(player/enemy), there are many discussions that tend to favor kinematic based characters, most major engines also were inclined for kinematic characters, now some engines have started to offer a “character” type or “API” for character movements.

Godot is really flexible, you have a kinematic body with a collision/overlap prevention API and a RigidBody with many modes, even a custom integrator for more precise manipulation of velocities.

I prefer kinematic characters because I never trust the physics engines xD
But again, since Godot offer a lot of customization for Rigids, these could be a good option too.


In general (here, with Box2D, Nape, etc.), StaticBodies are for things that never move or react, ideal for walls; moving platforms are better with KinematicBodies.


Also don’t forget Areas, these are for general detection plus some goodies like space override with physics alteration options, I use Areas for simple bullets too and work fine with all type of shapes (the rest have problems with lines).
Areas could be good for some characters/enemies and objects too, as main body or secondary to assist on detection, item magnet effect, etc.