In Unity3D, you need rigidbodies on GameObjects that use colliders, as they use physics. You don't need rigidbodies on static GameObjects because they don't use physics, though you still need to have at least one in the calculation.
My situation is this: I want the game to detect putting your head through a wall with colliders. I'm just curious, as the collider on the head won't use physics, does it still need a rigidbody as it's moving, just not with physics?
My question is: Does a VR object need a rigidbody? (and yes it set it to kinematic)
Colliders → Collision action matrix
=> It depends.
Some of the combinations only cause one of the two objects to be affected by the collision, but the general rule is that physics will not be applied to an object that doesn’t have a Rigidbody component attached.
You said
as the collider on the head won't use physics
But note that in general Collision = Physics.
So yes, at least one of the objects involved in a collision needs to be a (kinematic) Rigidbody.
As you can see in the matrix above e.g. for a collision with a static object the event (like OnCollisionEnter
) will be invoked only on the object with a (kinematic o not) Rigidbody
but not on the static object.
static here means it has no Rigidbody
component attached even if it is moved by code or in other words: As soon as something moves in your scene it should have a (kinematic) Rigidbody
component!
You can add colliders to a
GameObject
without aRigidbody
component to create floors, walls and other motionless elements of aScene
. These are referred to as static colliders. At the opposite, colliders on aGameObject
that has aRigidbody
are known as dynamic colliders.