SuperAPI AI 工具集

godot-animation-tree-mastery

设计与创作

查看项目

更新于 10-15 21:05

技能介绍

用途:为 Godot 的 AnimationTree 提供高级动画混合与状态机实践指导,覆盖 StateMachine 过渡、BlendSpace2D 方向移动、BlendTree 分层动画与根运动等场景。

主要能力:给出常见错误规避规则,例如使用 AnimationTree 时不要直接调用 AnimationPlayer.play(),需在 _ready 中设置 active = true,参数使用相对路径 "parameters/...",交互状态避免 auto_advance,1D 混合用 BlendSpace1D、两状态用 Blend2,避免每帧无保护地 set() 参数,简单逻辑不要用深层嵌套 BlendTree,长过场不要依赖 auto_advance,长度差异大的动画不要用 Sync 组。

使用方式:先在 AnimationTree 编辑器中制作图,再用脚本驱动。核心代码为 @onready var anim_tree: AnimationTree = $AnimationTree,通过 anim_tree.get("parameters/StateMachine/playback") 获取 AnimationNodeStateMachinePlayback,并在 _ready 中设置 anim_tree.active = true。提供脚本包括 sync_parameter_manager.gd、statemachine_travel_code.gd、tree_travel_manager.gd、nested_state_machine.gd、skeleton_ik_lookat.gd、reactive_oneshot_vfx.gd、dynamic_timescale_control.gd、advanced_transition_masking.gd、blendtree_logic_mixing.gd、root_motion_animtree_sync.gd、sync_group_layering.gd、nested_tree_architecture.gd、runtime_tree_debugging.gd、animation_event_dispatcher.gd、animation_complexity_manager.gd。

适用场景:5 个以上游戏状态与 travel、仅速度混合、X+Y 方向 strafe/aim、上半身叠加与战斗层、嵌套战斗/空中子状态机、look-at/IK、根运动提取、运行时调试与事件分发。

限制:资料未提供收费、价格、平台与效果信息;深层图配方 references/advanced-graph-recipes.md 仅在嵌套战斗图、IK look-at 或深层 BlendTree 分层时加载,否则不要加载。