Skip to content

raylib.GetRayCollisionBox

JoeStrout edited this page Nov 16, 2026 · 3 revisions

Get collision info between ray and bounding box, as a map with hit, distance, point and normal

Parameters

Parameter Default Value Note
ray
box

Return value

Condition Return Value
(always) map

Notes

Example

ray = {position:[0,5,0], direction:[0,-1,0]}
box = {min:[-1,-1,-1], max:[1,1,1]}
rc = raylib.GetRayCollisionBox(ray, box)
if rc.hit then
    print "Hit at distance: " + rc.distance
end if

Clone this wiki locally