Skip to content

raylib.GetRayCollisionSphere

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Get collision info between ray and sphere

Parameters

Parameter Default Value Note
ray
center
radius

Return value

Condition Return Value
(always) map

Notes

Example

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

Clone this wiki locally