RayCollide()
Syntax
Result = RayCollide(x, y, z, DestinationX, DestinationY, DestinationZ)Description
Casts a ray between the first point and the second point, and checks if an entity is colliding the ray. This function relies on the physic engine, which needs to be activated with EnableWorldPhysics() before using this command. Only entities with bodies will react to the ray. To get the position about the collide point, use PickX(), PickY() and PickZ(). The normals values at the collide point are available with NormalX(), NormalY() and NormalZ().
Parameters
x, y, z The first point coordinates, in world unit. DestinationX, DestinationY, DestinationZ The second point coordinates, in world unit.
Return value
Returns the entity number if the ray has collided with one, or -1 if no collision has occurred.
See Also
NormalX(), NormalY(), NormalZ()
Supported OS
All