文档

Unity Engine

Unity Engine

raycastsStartInColliders

Do ray/line casts that start inside a Collider(s) detect those Collider(s)?
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
警告
Removed. Physics2D.raycastsStartInColliders is deprecated. 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.