Reference/Datatypes/RaycastResult
Datatype · Structs

RaycastResult

struct

Result returned by physics.raycast. Contains information about what the ray hit.

Fields

NameTypeDescription
distancenumber

The distance from the ray origin to the hit point.

hit_successfulboolean

Whether the ray hit anything.

instanceBasePart | nil

The BasePart that was hit, or nil if nothing was hit or the hit object has no owning part.

positionVector3

The world position of the hit point.