FANDOM


In Roblox, a Ray is a line that starts at one point and goes in a direction infinitely. Rays are most used with the FindPartOnRay method of the ExplorerImageIndex 19Workspace.

Ray Lua Object

Constructors
Vector3 direction) Creates a new Ray at origin with a direction of direction
Fields
Vector3 Origin The start position of the Ray
Vector3 Direction The direction that the Ray is pointing
Methods
Number Distance(point) Returns the shortest distance from the ray to a point
Vector3 ClosestPoint(point) Returns the closest point on the Ray to the given point