Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TestOverlapShapeProxy

Test if the provided shape proxy overlaps any shapes.
Read time 2 minutesLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule

TestOverlapShapeProxy(ShapeProxy, QueryFilter)

Test if the provided shape proxy overlaps any shapes.
public bool TestOverlapShapeProxy(PhysicsShape.ShapeProxy shapeProxy, PhysicsQuery.QueryFilter filter)

Parameters

shapeProxy

The shape proxy to use. This must be in world-space.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapShapeProxy(ShapeProxy, Vector2, QueryFilter)

Test if the provided shape proxy overlaps any shapes.
public bool TestOverlapShapeProxy(PhysicsShape.ShapeProxy shapeProxy, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

shapeProxy

The shape proxy to use. This must be in local-space, relative to
origin
.

origin

The point, in world space, that the shape proxy is defined relative to. This lets the proxy be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapShapeProxy(ReadOnlySpan<ShapeProxy>, QueryFilter)

Test if the provided shape proxies overlaps any shapes.
public bool TestOverlapShapeProxy(ReadOnlySpan<PhysicsShape.ShapeProxy> shapeProxies, PhysicsQuery.QueryFilter filter)

Parameters

The shape proxy to use. This must be in world-space.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapShapeProxy(ReadOnlySpan<ShapeProxy>, Vector2, QueryFilter)

Test if the provided shape proxies overlaps any shapes.
public bool TestOverlapShapeProxy(ReadOnlySpan<PhysicsShape.ShapeProxy> shapeProxies, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The shape proxy to use. These must be in local-space, relative to
origin
.

origin

The point, in world space, that the shape proxies are defined relative to. This lets the proxies be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.