Table Of Contents

Previous topic

9.21. The TriangleArray Object

Next topic

9.23. The Character Object

This Page

9.22. The RayHit Object

A RayHit object contains result information of a ray test or a convex sweep test.

9.22.1. Properties

9.22.1.1. collisionObject

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

9.22.1.2. body

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

9.22.1.3. hitPoint

Summary

The Vector3 object representing the location in world space of the hit.

Syntax

var hitLocation = rayHit.hitPoint;

Note

Read Only

9.22.1.4. hitNormal

Summary

The Vector3 object representing the normal of the surface in world space of the hit.

Syntax

var hitNormal = rayHit.hitNormal;

Note

Read Only