Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

PhysicsBody3D

Inherits: CollisionObject3D < Node3D < Node < Object

Inherited By: CharacterBody3D, PhysicalBone3D, RigidBody3D, StaticBody3D

Abstract base class for 3D game objects affected by physics.

Description

PhysicsBody3D is an abstract base class for 3D game objects affected by physics. All 3D physics bodies inherit from it.

Warning: With a non-uniform scale, this node will likely not behave as expected. It is advised to keep its scale the same on all axes and adjust its collision shape(s) instead.

Tutorials

Properties

bool

axis_lock_angular_x

false

bool

axis_lock_angular_y

false

bool

axis_lock_angular_z

false

bool

axis_lock_linear_x

false

bool

axis_lock_linear_y

false

bool

axis_lock_linear_z

false

Methods

void

add_collision_exception_with ( Node body )

bool

get_axis_lock ( BodyAxis axis ) const

PhysicsBody3D[]

get_collision_exceptions ( )

KinematicCollision3D

move_and_collide ( Vector3 motion, bool test_only=false, float safe_margin=0.001, bool recovery_as_collision=false, int max_collisions=1 )

void

remove_collision_exception_with ( Node body )

void

set_axis_lock ( BodyAxis axis, bool lock )

bool

test_move ( Transform3D from, Vector3 motion, KinematicCollision3D collision=null, float safe_margin=0.001, bool recovery_as_collision=false, int max_collisions=1 )


Property Descriptions

bool axis_lock_angular_x = false

Lock the body's rotation in the X axis.


bool axis_lock_angular_y = false

Lock the body's rotation in the Y axis.


bool axis_lock_angular_z = false

Lock the body's rotation in the Z axis.


bool axis_lock_linear_x = false