Version: 2022.3
LanguageEnglish
  • C#

PhysicsShapeType2D.Edges

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Use multiple edges to interpret the PhysicsShape2D geometry.

An edge geometry type is comprised of an unlimited quantity of vertices in the PhysicsShape2D and a PhysicsShape2D.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 PhysicsShape2D.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 PhysicsShape2D.adjacentStart and PhysicsShape2D.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.