文档

Unity Engine

Unity Engine

OverlapPoint(Vector2)

Check if any of the Rigidbody2D colliders overlap a point in space.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public bool OverlapPoint(Vector2 point)

Parameters

point

A point in world space.

Returns

Type

Description

boolWhether the point overlapped any of the Rigidbody2D colliders.

Remarks

Any EdgeCollider2D attached to the Rigidbody2D won't be checked for an overlapping point as they don't have any area therefore do not support this.