Static Rigidbody 2D or just Collider 2D

I’m a beginner at Unity. As far as I know, it’s a Static Rigidbody 2D is designed to not move under simulation at all like ground, walls…

However, in my game, I only push a Box Collider 2D component to the game object wall. That game object perfectly acts as a wall when other rigid body interacts with it.

Should I add a Rigidbody 2D component with static body type in my wall?

Hi,

From what I read, all game objects with colliders that do not have a Rigidbody2D get a static Rigidbody2D attached when you click the Play button. Do add a Rigidbody2D to game objects with a collider that are supposed to move. That will increase the performance of your game. Do not move a Collider2D without a static Rigidbody2D or no Rigidbody2D component.

In a little game like ours, the difference is not noticeable but in larger games moving static colliders/rigidbodys could have a significant negative impact on the performance.

Has your question been answered?


See also:

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

Privacy & Terms