RAYCAST
Raycasting for collision detection.
Availability: Client & Server
Methods
RAYCAST.from
client server
Cast a ray from a position in a direction
Signature: obj action(num, num, num, num, num, num)
Parameters:
| Name | Type | Description |
|---|---|---|
x | num | Starting X position |
y | num | Starting Y position |
z | num | Starting Z position |
xD | num | X direction component |
yD | num | Y direction component |
dist | num | Maximum distance to cast |
Returns: obj - Raycast hit result
obj result = GAME.RAYCAST.from(0, 10, 0, 0, 0, 0);
RAYCAST.fromPlayer
client server
Cast a ray from a player's position in their look direction
Signature: action(obj, num)
Parameters:
| Name | Type | Description |
|---|---|---|
player | obj | The player object to cast from |
dist | num | Maximum distance to cast |
GAME.RAYCAST.fromPlayer(player, 0);