A RayHit object contains result information of a ray test or a convex sweep test.
Summary
The CollisionObject that caused the hit, or null if the test hit a RigidBody.
Syntax
var collisionObject = rayHit.collisionObject;
if (collisionObject)
{
}
Note
Read Only
Summary
The RigidBody that caused the hit, or null if the test hit a CollisionObject.
Syntax
var body = rayHit.body;
if (body)
{
}
Note
Read Only