Data type
RaycastResult
Stores results from a raycast operation.
The RaycastResult data type stores the result of a successful
raycasting operation performed by WorldRoot:Raycast(). It contains the
properties listed below.
This object should not be confused with the similarly-named
RaycastParams which is used to perform a raycast.
Properties 5#
Distancenumber | The distance between the ray origin and the intersection point. |
InstanceBasePart | The BasePart or Terrain cell that the ray intersected. |
MaterialMaterial | The Material at the intersection point. |
PositionVector3 | The world space point at which the intersection occurred. |
NormalVector3 | The normal vector of the intersected face. |
Distance: number#
The distance between the ray origin and the intersection point.
Instance: BasePart#
Material: Material#
The Material at the intersection point. For normal parts this is
the BasePart.Material; for Terrain this can vary depending
on terrain data.
Position: Vector3#
Normal: Vector3#
The normal vector of the intersected face.