Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


raycastsStartInColliders

Do ray/line casts that start inside a Collider(s) detect those Collider(s)?
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
Warning
Removed. Physics2D.raycastsStartInColliders is obsolete. Use Physics2D.queriesStartInColliders instead.
public static bool raycastsStartInColliders { get; set; }

Remarks

When performing a ray/line cast, the start point can begin inside a Collider. When this occurs, this property controls whether these Colliders are returned or not. When set to true, such Colliders are returned.
Additional Resources: Physics2D.Raycast, Physics2D.Linecast.