CapsuleShape2D

Inherits: Shape2D < Resource < RefCounted < Object

Capsule shape resource for 2D physics.

Description

2D capsule shape to be added as a direct child of a PhysicsBody2D or Area2D using a CollisionShape2D node. In 2D, a capsule is a rectangle shape with half-circles at both ends.

Performance: Being a primitive collision shape, CapsuleShape2D is fast to check collisions against (though not as fast as CircleShape2D).

Properties

float

height

30.0

float

radius

10.0

Property Descriptions

Default

30.0

Setter

set_height(value)

Getter

get_height()

The capsule's height.


Default

10.0

Setter

set_radius(value)

Getter

get_radius()

The capsule's radius.