CharacterBody3D
Inherits: PhysicsBody3D < CollisionObject3D < Node3D < Node < ObjectDescription
A 3D physics body specialized for characters moved by script. They are mainly used to provide high-level API to move objects with wall and slope detection.Properties
Vector3
default:"Vector3(0, 0, 0)"
Current velocity vector (typically meters per second), used and modified during calls to move_and_slide.
MotionMode
default:"MOTION_MODE_GROUNDED"
Sets the motion mode which defines the behavior of move_and_slide.
Vector3
default:"Vector3(0, 1, 0)"
Vector pointing upwards, used to determine what is a wall and what is a floor.
float
default:"0.785398"
Maximum angle (in radians) where a slope is still considered a floor (45 degrees).
float
default:"0.1"
Sets a snapping distance. When set to a value different from 0.0, the body is kept attached to slopes.
Methods
move_and_slide
is_on_floor
is_on_wall
is_on_ceiling
get_floor_normal
Example Usage
- GDScript
- C#