Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


EdgeCollider2D

Collider for 2D physics representing an arbitrary set of connected edges (lines) defined by its vertices.
Read time 10 minutesLast updated 2 days ago

Definition

public sealed class EdgeCollider2D : Collider2D

Remarks

Properties

Property

Description

adjacentEndPointDefines the position of a virtual point adjacent to the end point of the EdgeCollider2D.
adjacentStartPointDefines the position of a virtual point adjacent to the start point of the EdgeCollider2D.
edgeCountGets the number of edges.
edgeRadiusControls the radius of all edges created by the collider.
pointCountGets the number of points.
pointsGet or set the points defining multiple continuous edges.
useAdjacentEndPointSet this to true to use the _adjacentEndPoint to form the collision normal that is used to calculate the collision response when a collision occurs at the Edge Collider's end point. Set this to false to not use the _adjacentEndPoint, and the collision normal becomes the direction of motion of the collision.
useAdjacentStartPointSet this to true to use the _adjacentStartPoint to form the collision normal that is used to calculate the collision response when a collision occurs at the Edge Collider's start point. Set this to false to not use the _adjacentStartPoint, and the collision normal becomes the direction of motion of the collision.

Methods

Method

Description

GetPointsGets all the points that define a set of continuous edges.
ResetReset to a single edge consisting of two points.
SetPointsSets all the points that define a set of continuous edges.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.