A ray has one origin point in the 3D scene and a direction. It returns potentials Impacts and the distance from the origin when that happens.
Creates a Ray with an origin and a direction.
local ray = Ray(Camera.Position, Camera.Forward) local impact = ray:Cast()
Pointer.Down = function( pointerEvent ) local ray = Ray(pointerEvent.Position, pointerEvent.Direction) local impact = ray:Cast() if impact.Block ~= nil then print("block hit:", impact.Block) end end