Up to date

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

AnimatableBody3D

继承: StaticBody3D < PhysicsBody3D < CollisionObject3D < Node3D < Node < Object

无法被外力移动的 3D 物理物体。手动移动时会影响路径上的其他物体。

描述

可动画的 3D 物理物体。无法因外力或接触而移动,但可以通过代码、AnimationMixerAnimationMixer.callback_mode_process 设为 AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS)、RemoteTransform3D 等方法手动移动。

AnimatableBody3D 发生移动时,会对线速度和角速度进行估算,并用于影响其路径上的其他物理物体。因此适用于移动平台、门等移动的对象。

教程

属性

bool

sync_to_physics

true


属性说明

bool sync_to_physics = true

  • void set_sync_to_physics ( bool value )

  • bool is_sync_to_physics_enabled ( )

如果为 true,则实体的运动将与物理帧同步。当通过 AnimationPlayer 为运动设置动画时,例如在移动的平台上,这个功能很有用。请不要PhysicsBody3D.move_and_collide 函数一起使用。