Optional
options: Partial<PolygonColliderOptions>Ignores collisions with layers in the array
Collision layer
X-Y axis offset
TRUE if this collider interact with rigid bodies
Edges rotation in radians
Collection of 2d vectors representing the vertices of the collider
The PolygonCollider component defines a convex polygon-shaped collision area for an entity.
It can be used for both physics interactions and collision detection.
The collider's shape is determined by a series of vertices that form a closed convex polygon.
Note that only convex polygons are supported - concave shapes must be broken into multiple convex polygons.
The shape can be offset and rotated, and collision layers allow controlling which objects can collide with each other.
Example