← Back to Nodes
CollisionShape2D
⚠️ Experimental - Pre-Release
Inheritance Hierarchy
Inherits:
Inheritance Chain:
Node → Node2D → CollisionShape2D
CollisionShape2D is a 2D collision shape node used for physics. It extends Node2D and defines collision shapes for physics bodies.
Fields
shape: ColliderShape?
The collision shape. Optional - can be set to define the collision geometry.
@script Collider extends CollisionShape2D fn init() { // Set collision shape self.shape = my_collider_shape }Inherited Fields: CollisionShape2D also has all fields from Node2D: transform, pivot, visible, z_index
