sm.physics.distanceRaycast
Performs a distance ray cast from a position with a given direction.
Kind: Function
Environments: Game
Game
sm.physics.distanceRaycast( start, direction )
Note: sm.physics.distanceRaycast is generally cheaper to use than sm.physics.raycast as it performs collision checks in a simplified world. If the raycast is only used for checking collision, it is advised to use this method instead.
Parameters:
Returns:
| Type | Description |
|---|---|
| boolean | 2 values: whether raycast was successful |
| number | the fraction (0–1) of the distance reached until collision divided by the ray's length. |