Godot 动画 — 快速参考¶
最后验证:2026-02-12 | 引擎:Godot 4.6
自 ~4.3 以来的变更(LLM 截止点)¶
4.6 变更¶
- IK 系统已完全恢复:为 3D 骨骼提供完整的反向动力学支持
- CCDIK、FABRIK、Jacobian IK、Spline IK、TwoBoneIK
- 通过
SkeletonModifier3D节点应用(不再是旧的 IK 方式) - 动画编辑器体验改进:支持对贝塞尔节点组进行 Solo/隐藏/锁定/删除;时间轴可拖拽
4.5 变更¶
BoneConstraint3D:使用修改器将骨骼绑定到其他骨骼AimModifier3D、CopyTransformModifier3D、ConvertTransformModifier3D
4.3 变更(训练数据中)¶
AnimationMixer:作为AnimationPlayer和AnimationTree两者的基类method_call_mode→callback_mode_methodplayback_active→activebone_pose_updated信号 →skeleton_updatedSkeleton3D.add_bone():现在返回int32(原为void)
当前 API 模式¶
AnimationPlayer(API 未变,基类已更新)¶
@onready var anim_player: AnimationPlayer = %AnimationPlayer
func play_attack() -> void:
anim_player.play(&"attack")
await anim_player.animation_finished
IK 设置(4.6 — 新增)¶
# Add SkeletonModifier3D-based IK nodes as children of Skeleton3D
# Available types:
# - SkeletonModifier3D (base)
# - TwoBoneIK (arms, legs)
# - FABRIK (chains, tentacles)
# - CCDIK (tails, spines)
# - Jacobian IK (complex multi-joint)
# - Spline IK (along curves)
# Configure in editor or code:
# 1. Add IK modifier node as child of Skeleton3D
# 2. Set target bone and tip bone
# 3. Add a Marker3D as the IK target
# 4. IK solver runs automatically each frame
BoneConstraint3D(4.5 — 新增)¶
# Add as child of Skeleton3D
# Types:
# - AimModifier3D: Point bone at target
# - CopyTransformModifier3D: Mirror another bone's transform
# - ConvertTransformModifier3D: Remap transform values
AnimationTree(基类在 4.3 中变更)¶
# AnimationTree now extends AnimationMixer (not Node directly)
# Use AnimationMixer properties:
@onready var anim_tree: AnimationTree = %AnimationTree
func _ready() -> void:
anim_tree.active = true # NOT playback_active (deprecated 4.3)
常见错误¶
- 使用了
playback_active而不是active(自 4.3 起已弃用) - 使用
bone_pose_updated信号而不是skeleton_updated(在 4.3 中已重命名) - 使用旧的 IK 方式而不是
SkeletonModifier3D系统(在 4.6 中已恢复) - 在对动画节点进行类型检查时,未使用
is AnimationMixer检查
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 cl/Claude-Code-Game-Studios