PolyCollisionShape2D¶
Inherits: PolyShape2D < Node2D < CanvasItem < Node < Object
A collision shape based on PolyNode2D outlines.
Description¶
A class which allows to use PolyNode2D nodes as children to build collision shapes from. Applicable for both for static and rigid bodies, similarly to CollisionPolygon2D.
Properties¶
| bool | disabled | false |
| bool | one_way_collision | false |
| float | one_way_collision_margin | 1.0 |
Property Descriptions¶
- bool disabled
| Default | false |
| Setter | set_disabled(value) |
| Getter | is_disabled() |
If true, no collisions will be detected.
- bool one_way_collision
| Default | false |
| Setter | set_one_way_collision(value) |
| Getter | is_one_way_collision_enabled() |
If true, only edges that face up, relative to this node’s rotation, will collide with other objects.
- float one_way_collision_margin
| Default | 1.0 |
| Setter | set_one_way_collision_margin(value) |
| Getter | get_one_way_collision_margin() |
The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity.