Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Edges

Use multiple edges to interpret the PhysicsShape2D geometry.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Field
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
Edges = 3

Remarks

An edge geometry type is comprised of an unlimited quantity of vertices in the PhysicsShape2D and a _radius. The vertices represent the consecutive edges where each vertex connects to the next vertex. These edges represent an open shape with no interior even if the first and last vertices overlap. The _radius is the radius of all edges. (Edges with a radius of zero become infinitely thin edges while a radius greater than zero results in capsule shaped edges i.e. any edge with a radius.)
Edges also have an _adjacentStart and _adjacentEnd feature allowing separate edge shapes to be joined.
NOTE: You should ensure that edges do not self-intersect as this can produce incorrect collision responses. As checking self-intersection has a runtime cost, this constraint is not validated and so you should ensure this does not occur.