different about staticbody and rigidbody as static

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wahyuadiramadan

what the different about staticbody and rigidbody as static, im try to make simple endless run game and using rigid as player and the obstacle, and automatically created the obstacle, im not sure about this but, is there will be a problem if there are too many rigidbody in one scene? how many rigidbody godot can handle in one scene?

:bust_in_silhouette: Reply From: Zylann

I think there is no difference between a StaticBody and a rigidbody set to static mode. StaticBody is mostly a shortcut for a body that you know will always be static, it saves time setting it up.
On the other hand, RigidBody allows to change its mode during the game, and that includes being static. It is a more versatile node but it’s a bit more complicated to use.

ok, thanks for your answer zylann

im not sure about this but, is there will be a problem if there are too many rigidbody in one scene?

wahyuadiramadan | 2020-03-18 08:28

Like anything, there is a limit in how many you can have, and that depends on the kind of machine you want your game to run on. You may have to test how your game behaves with the amount you want.
Static bodies usually cost a lot less than rigidbodies. They essentially occupy memory and don’t really use CPU on their own, but they begin to cost CPU if a rigidbody or kinematic body starts getting close to them.

Zylann | 2020-03-18 22:14

I think there is no difference between a StaticBody and a rigidbody set to static mode.

Last time I checked, a RigidBody in Static mode can report its collisions unlike a StaticBody.

Calinou | 2020-03-24 15:06

Calinou: sounds like an API consequence, unless it’s actually a feature of Bullet?

Zylann | 2020-03-24 18:20

Zylann: I think it works like that when using GodotPhysics too.

Calinou | 2020-03-24 23:02