RayCast#
RayCast(Vector3, Vector3, out float, CollisionLayer)
#
Call this once each frame to do the query.
Declaration#
public bool RayCast(Vector3 origin, Vector3 direction, out float distance, CollisionLayer layer = CollisionLayer.Everything)
Parameters#
origin |
World space position of ray origin |
direction |
World space ray direction |
distance |
The distance along the ray to the first intersection with the water surface. |
layer |
The layer this ray targets. |
Return#
True if the results have come back from the GPU, and if the ray intersects the water surface.