Show intersection tests with debug-draw.
Filter settings applied to intersection tests.
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Returns (via callback) the nearest intersection in any world. If there is no hit, the callback is called with a null hit argument. Ray casts are performed after simulation update, which occurs after script Update but prior to LateUpdate.
Returns (via callback) all intersections in every world. The callback receives an array of hits, in order of nearest to farthest. If there were no hits, the array length is 0. Ray casts are performed after simulation update, which occurs after script Update but prior to LateUpdate.
Returns all intersections synchronously, in order of nearest to farthest. If there were no hits, the array length is 0.
See Probe#rayCastSync for timing considerations.
Returns the nearest intersection synchronously. If there is no hit, returns null. Unlike rayCast(), the result is returned directly without a callback.
For current-frame results, call this in LateUpdate. The physics simulation step runs between Update and LateUpdate, so calling in Update, onStart, or event handlers will return results based on the previous frame's physics state.
Note: dynamically scaled or created physics objects may not be reflected in results until the next physics step has processed them.
Like rayCast(), but sweeps a sphere from start to end positions. This is shorthand for calling shapeCast() with a SphereShape. Returns (via callback) the nearest intersection. If there is no hit, the callback is called with a null hit argument. Ray casts are performed after simulation update, which occurs after script Update but prior to LateUpdate.
Like rayCastAll(), but sweeps a shape from start to end transforms (expressed as position and rotation). The provided shape can be created with one of the Shape.create*() functions, or referenced from a Physics.ColliderComponent. Does not support MeshShape, and will throw an exception if attempted. Returns (via callback) all intersections. The callback receives an array of hits, in order of nearest to farthest. If there were no hits, the array length is 0. Ray casts are performed after simulation update, which occurs after script Update but prior to LateUpdate.
Like rayCastAllSync(), but sweeps a shape from start to end transforms. Returns all intersections synchronously. Does not support MeshShape, and will throw an exception if attempted.
See Probe#rayCastSync for timing considerations.
Like rayCastSync(), but sweeps a shape from start to end transforms. Returns the nearest intersection synchronously, or null if there is no hit. Does not support MeshShape, and will throw an exception if attempted.
See Probe#rayCastSync for timing considerations.
Like rayCast(), but sweeps a sphere from start to end positions. This is shorthand for calling shapeCast() with a SphereShape. Returns (via callback) the nearest intersection. If there is no hit, the callback is called with a null hit argument. Ray casts are performed after simulation update, which occurs after script Update but prior to LateUpdate.
Like rayCastAll(), but sweeps a sphere from start to end positions. This is shorthand for calling shapeCastAll() with a SphereShape. Returns (via callback) all intersections. The callback receives an array of hits, in order of nearest to farthest. If there were no hits, the array length is 0. Ray casts are performed after simulation update, which occurs after script Update but prior to LateUpdate.
Like rayCastAllSync(), but sweeps a sphere from start to end positions. Returns all intersections synchronously.
See Probe#rayCastSync for timing considerations.
Like rayCastSync(), but sweeps a sphere from start to end positions. Returns the nearest intersection synchronously, or null if there is no hit.
See Probe#rayCastSync for timing considerations.
Performs collision tests (such as ray casts) in one or more world.
See
Example