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 give create solid object. IMPORTANT: this is an Editor-only helper to create shapes, use GetShape() to get the actual shape.

Inheritance Chain

Constructors

    public CollisionShape2D()

Properties

    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 Shape2D Shape { get; set; }

The actual shape owned by this collision shape.

Methods

    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 SetShape(Shape2D shape)

Setter for Shape

Tags: