Node that represents collision shape data in 2D space.
    public class CollisionShape2D : Node2D

Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an Area2D to give it a detection shape, or add it to a PhysicsBody2D to create a solid object. IMPORTANT: this is an Editor-only helper to create shapes, use CollisionObject2D.ShapeOwnerGetShape(int, int) to get the actual shape.

Inheritance Chain


    public CollisionShape2D()


    public bool Disabled { get; set; }

A disabled collision shape has no effect in the world.

    public bool OneWayCollision { get; set; }

Sets whether this collision shape should only detect collision on one side (top or bottom).

    public float OneWayCollisionMargin { get; set; }

    public Shape2D Shape { get; set; }

The actual shape owned by this collision shape.


    public float GetOneWayCollisionMargin()

Getter for OneWayCollisionMargin

    public Shape2D GetShape()

Getter for Shape

    public bool IsDisabled()

Getter for Disabled

    public bool IsOneWayCollisionEnabled()

Getter for OneWayCollision

    public void SetDisabled(bool disabled)

Setter for Disabled

    public void SetOneWayCollision(bool enabled)

Setter for OneWayCollision

    public void SetOneWayCollisionMargin(float margin)

Setter for OneWayCollisionMargin

    public void SetShape(Shape2D shape)

Setter for Shape