Make AnimationTree more user-friendly #12624
FlooferLand
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problems
First, lets say you have a 3D game and one main state machine that contains 2 other state machines, one state machine that handles idle/walking/running animations as well as another state machine that handles interaction animations, and you want to change how they are structured (moving 2 of the state machines inside another state machine?). This is currently impossible as there's no way to copy their data to the clipboard, and if you save their
AnimationNodeStateMachinePlayback
from the inspector or copy them to your clipboard, you won't be able to load them back in. As far as I've tested the only way to do this animation refactoring is to remake both state machines from scratch.Second, state transitions are rather messy. You cannot have

!moving
as an advance condition, you must add another separate boolean callednot_moving
, or you could use expressions which lack any good documentation (especially in-editor) and require setting up variables in a script as well as settingadvance_expression_base_node
to the node containing those variables.The prior is what I've noticed most people end up doing, and it results in a rather polluted inspector after only adding 4 animations:
There's also the problem of it generally not being user-intuitive, and the UI being very barebones and what I can only describe as a 3.x remnant. When compared to animation tree / state machine solutions other game engines provide, Godot's
AnimationTree
falls behind immediately.Godot lacks this and requires manually creating a transition to/from each one, which can get very messy.
expression
field because of this.The general solution to all these problems that I've seen is using several
AnimationPlayer
s while manually creating your own animation state manager via script as a workaround.Solutions
I lack the time / engine knowledge to implement these myself, but I hope this sparks a discussion to either fix the existing
AnimationTree
's flaws or fundamentally fix it's issues via a rewrite.I propose 2 main solutions; Neither are are final, and I'd appreciate further feedback and more ideas as this is a discussion thread.
1. A new
AnimationTree
This solution would most closely represent the current
AnimationTree
system, and this could either be a brand new node or improvements to the existingAnimationTree
, though the latter could make it challenging when it comes to keeping backwards compatibility so I would not recommend it.Here are some major improvements I've thought up:
A separate editing interface you can fullscreen
A new "Properties" panel on the left that lets you define animation properties as well as their types, giving you autocomplete for state transition conditions, and potentially letting you use inline GDScript?
Revamped interface; Allows copy/pasting of states, and dragging/dropping of states into other states (state grouping of sorts)
condition
is fully replaced byexpression
.(When upgrading a project to the new animation tree system, the value inside
condition
could simply be moved into theexpression
during the project upgrade)2. Animation scripts
This solution is more similar to Unreal Engine's animation blueprints, using scripts to define when and how animations get played.
I'm not sure about the actual API for this, but here's an example of what I mean:
Beta Was this translation helpful? Give feedback.
All reactions