RaycastHit.Rigidbody

The Rigidbody of the collider that was hit.

RaycastHit.Rigidbody

Property Name Description
Raycast Hit RaycastHit
Rigidbody Output hit Rigidbody

If the collider is not attached to a rigidbody then it is null.