Rigidbody.SweepTestfunction SweepTest (direction : Vector3, out hitInfo : RaycastHit, distance : float = Mathf.Infinity) : booleanParameters
Returnsboolean - True when the rigidbody sweep intersects any collider, otherwise false. DescriptionTests if a rigidbody would collide with anything, if it was moved through the scene. This is similar to doing a Physics.Raycast for all points contained in any of a Rigidbody's colliders, and returning the closest of all hits (if any) reported. This is useful for AI code, when you need to know if an object would fit somewhere without colliding with anything. See Also: Physics.SphereCast, Physics.CapsuleCast, Rigidbody.SweepTestAll
JavaScript
var hit : RaycastHit; using UnityEngine; import UnityEngine
|
