Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Distance(PhysicsShape, bool)

Get the minimum distance between all the shapes attached to this body and the specified shape.
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public PhysicsQuery.DistanceResult Distance(PhysicsShape physicsShape, bool useRadii = true)

Parameters

physicsShape

The shape to check the distance of.

useRadii

Whether to use the radii of all shapes or not.

Returns

Type

Description

DistanceResultThe distance result.