Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
AnimatableBody2D¶
继承: StaticBody2D < PhysicsBody2D < CollisionObject2D < Node2D < CanvasItem < Node < Object
无法被外力移动的 2D 物理物体。手动移动时会影响路径上的其他物体。
描述¶
可动画的 2D 物理物体。无法因外力和接触而移动,但可以通过代码、AnimationMixer(AnimationMixer.callback_mode_process 设为 AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS)、RemoteTransform2D 等方法手动移动。
AnimatableBody2D 发生移动时,会对线速度和角速度进行估算,并用于影响其路径上的其他物理物体。因此适用于移动平台、门等移动的对象。
属性¶
|
属性说明¶
bool sync_to_physics = true
如果为 true
,则物体的运动将与物理帧同步。当通过 AnimationPlayer 为运动设置动画时,例如在移动的平台上,这个功能很有用。不要与PhysicsBody2D.move_and_collide一起使用。