Skip to main content

Plane.Raycast(Ray ray)

Intersects a ray with the plane.

Parameters:

NameTypeDescription
rayRaythe Ray to be cast

Returns:

typeDescription
booleanIs intersect?
numberDistance from Intersect

Usage

---@type Plane
local plane;

---@type Ray
local ray;


local val0, val1 = plane.Raycast(ray)

Extra Detail

This function returns the distance along the ray, where it intersects the plane. If the ray is parallel to the plane, function returns false and returns zero. If the ray is pointing in the opposite direction than the plane, function returns false/ and returns the distance along the ray (negative value).