Skip to content

raylib.CheckCollisionLines

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Check the collision between two lines defined by two points each, returns collision point by reference REF: https://en.wikipedia.org/wiki/Line–line_intersection#Given_two_points_on_each_line_segment

Parameters

Parameter Default Value Note
startPos1
endPos1
startPos2
endPos2

Return value

Condition Return Value
(always) list

Notes

Example

// result is [hit, collisionPoint] where hit is 0 or 1
result = raylib.CheckCollisionLines([0, 100], [400, 100], [200, 0], [200, 300])
if result[0] then print "Lines cross at: " + result[1]

Clone this wiki locally