er2.raycast 2

Casts a ray from an origin toward a direction. Used to test collisions and objects presence.
The test is done trough a Unity Raycast.


Return value

Return TypeDescription
floatReturns the distance from the ray's origin to the impact point. Returns -1 if the ray doesn't intersects with any Collider.

Parameters

ParameterTypeDescription
1vec3The starting point of the ray
2vec3The direction of the ray
3float(Optional) The max distance the ray should check for collisions. If not specified, max distance will have no limit

Examples

No examples available.


Back to Scripting API