Abstract Class: Collider2DComponent
2D colliders (Unity's Collider2D family). A collider belongs to the nearest Rigidbody2D on its entity or an ancestor; without one it's static scenery that follows its Transform. Geometry is in the entity's local pixels around its origin (the pivot), scaled by its world scale. Physics2DSystem rebuilds a collider's fixtures when a field changes (dirty, which it owns) or its scale / placement under the body does.
Extends
Extended by
BoxCollider2DComponentCircleCollider2DComponentCapsuleCollider2DComponentPolygonCollider2DComponentEdgeCollider2DComponent
Constructors
Constructor
ts
new Collider2DComponent(): Collider2DComponent;Returns
Collider2DComponent
Inherited from
Properties
| Property | Modifier | Type | Default value | Inherited from |
|---|---|---|---|---|
bounciness | public | number | undefined | - |
density | public | number | undefined | - |
dirty | public | boolean | true | Component.dirty |
enabled | public | boolean | true | Component.enabled |
friction | public | number | undefined | - |
isTrigger | public | boolean | undefined | - |
layer | public | number | undefined | - |
offsetX | public | number | undefined | - |
offsetY | public | number | undefined | - |
Accessors
attachedRigidbody
Get Signature
ts
get attachedRigidbody(): Rigidbody2DComponent | null;The Rigidbody2D this collider moves with (null = static scenery, or not simulated yet).
Returns
Rigidbody2DComponent | null
Methods
OverlapPoint()
ts
OverlapPoint(x, y): boolean;Whether the world point (px) is inside this collider. False until it's simulated.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
boolean