Data type
Ray
Represents a line with a starting point that casts infinitely in a specific direction.
About Ray
The Ray data type represents a half-line, finite in one direction
but infinite in the other. It can be defined by a 3D point, where the line
originates from, and a direction vector, which is the direction it goes in.
Constructors 1
Ray.new
(Origin: Vector3, Direction: Vector3)Returns aRaywith the givenOriginandDirection.
Properties 3
Methods 2
Distance
(point: Vector3) → numberReturns the distance between the given point and the closest point on theRay.Returns the distance between the given point and the point on the ray nearest to the given point (
Datatype.Ray.ClosestPoint(point)).
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.