#I'm confused by all the different physics bodies

1 messages · Page 1 of 1 (latest)

keen dagger
#

Hello! Newbie to Godot here, and coming from Unity where there's only really one physics body that is actually used in practice, I'm confused by the actual differences between the different physics bodies - RigidBody, CharacterBody, StaticBody and AnimatableBody. The descriptions in the editor somewhat help, but I still can't intuitively figure out which one to use where.

Can anyone explain what the differences between them actually are in practice? And maybe if you could also provide examples of when each one would be used?

It's happened multiple times now that I wrote an entire script and realised I probably need to use a different physics body and had to rewrite the whole thing

THANK YOU!!!! :D

stable stump
#

from 1 hour 53 minutes in the Ultimate Guide to Godot video by Clear Code

keen dagger
#

fantastic, thank you :)

shrewd tartan
#

Yeah, Rigidbody in Unity is split into four or five classes in Godot

#

Trigger > Area
Dynamic > RigidBody
Kinematic > AnimatableBody
Static > StaticBody

#

(I mean the the way Rigidbody used to work in Unity, at some point they got rid of Static and made Kinematic a bool)

#

Godot's CharacterBody is more flexible and useful than the equivalent in Unity, in my opinion

#

All the PhysicsBodies have move_and_collide, where you manually move the body each frame and get the collision results back

#

CharacterBody also has move_and_slide, which is real old-school manual physics movement

#

CharacterController, that's what it was called in Unity

#

Also, in Godot, collision layers are divided into "hits" and "hit by"!

#

So no annoying layer interaction matrix!

#

You can have a body that hits a certain layer, but doesn't get hit by anything, it's so much more flexible