Skip to content

raylib.GetRayCollisionMesh

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Get collision info between ray and mesh

Parameters

Parameter Default Value Note
ray
mesh
transform MatrixIdentity

Return value

Condition Return Value
(always) map

Notes

Example

ray = {position:[0,5,0], direction:[0,-1,0]}
mesh = raylib.GenMeshCube(2, 2, 2)
rc = raylib.GetRayCollisionMesh(ray, mesh, raylib.MatrixIdentity)
if rc.hit then
    print "Hit mesh at distance: " + rc.distance
end if
raylib.UnloadMesh mesh

Clone this wiki locally