You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this is the animation tree for my beat em up character
I added the hurt and knockout states today, and it made a whole mess of it, since you can go from any ground state to any hurt state and from almost any state to knockout_launch.
I was trying to see if I could organize or do this in a better way, as I still have more attacks and grab/throws to add, when I noticed we can now add transitions directly to another state inside an AnimationNodeStateMachine! Wonderfull! In fact I had not done jump as an AnimationNodeStateMachine because I needed to be able to go to the "falling" state at any time, but now that I know I can create transitions directly to it, I was able to reorganize my AnimationTree like this:
Much better!
But when I tried to code the transitions, it doesn't work.
If, for example, I do:
_playback.travel("attack_group/attack1")
I get:
E 0:00:00:0569 _travel: Condition "!p_state_machine->states.has(p_travel)" is true. Returning: false
<C++ Source> scene/animation/animation_node_state_machine.cpp:179 @ _travel()
var state_machine = _animation_tree.tree_root["nodes/state_machine/node"] as AnimationNodeStateMachine
var value = state_machine.has_transition("idle", "attack_group/attack1")
_playback.travel("attack_group/attack1")
print("value: %s"%[value])
prints true:
So when I ask AnimationNodeStateMachine if the transition is valid through GDScript, I get a true, but apparently the AnimationNodeStateMachinePlayback can't find it.
If needed I can provide prints from the "child" state machines or from the transitions in the inspector, I was just trying to not spam the description with even more images.
Steps to reproduce
Use the MRP below, or:
Create a Scene with at least two animations
Create an AnimationTree with a AnimationNodeStateMachine as root
Add one animation directly and another inside a new AnimationNodeStateMachine
Connect the outside animation directly to the inside animation
The default scene has everything set up, just run it and use the arrow keys to try to play different animations
Only ui_right and ui_down will work, as they are transitions between the "idle" state and the "move_group" state, both which are on the same AnimationNodeStateMachine.
ui_up and ui_left which are transitions from "idle" directly to AnimationNodeAnimations inside the "move_group" AnimationNodeStateMachine, will not work, even though they'll print that the transition is valid (when you are coming from idle)
The text was updated successfully, but these errors were encountered:
@Calinou Shouldn't this be tagged as 4.0? As connections to states inside another AnimationNodeStateMachine are not available on 3.x (at least up to 3.4), and this is only a bug if I can make this connections in the editor but not travel to them in runtime.
@TokageItLab just noticed this was moved to 4.x, wouldn't it be better to remove the UI that allows for connecting a state node directly to a child state node of another state machine? I mean, if I can't travel to it, why can I connect it?
Or is this a problem only when trying to use travel from code, but if you use conditions for auto-traveling it works?
TokageItLab
changed the title
AnimationTree: travelling directly to a state inside a child AnimationNodeStateMachine doesn't work, even though the transition is valid.
AnimationTree: travelling directly to a state inside a SubStateMachine doesn't work, even though the transition is valid.
Jan 19, 2023
Godot version
4.0.alpha10
System information
Manjaro Linux, Nvidia proprietary drivers, Vulkan Clustered
Issue description
So this is the animation tree for my beat em up character
I added the hurt and knockout states today, and it made a whole mess of it, since you can go from any ground state to any hurt state and from almost any state to knockout_launch.
I was trying to see if I could organize or do this in a better way, as I still have more attacks and grab/throws to add, when I noticed we can now add transitions directly to another state inside an AnimationNodeStateMachine! Wonderfull! In fact I had not done jump as an AnimationNodeStateMachine because I needed to be able to go to the "falling" state at any time, but now that I know I can create transitions directly to it, I was able to reorganize my AnimationTree like this:
Much better!
But when I tried to code the transitions, it doesn't work.
If, for example, I do:
I get:
(link to github source I got from right clickig error)
Even though this:
prints
true
:So when I ask AnimationNodeStateMachine if the transition is valid through GDScript, I get a
true
, but apparently the AnimationNodeStateMachinePlayback can't find it.If needed I can provide prints from the "child" state machines or from the transitions in the inspector, I was just trying to not spam the description with even more images.
Steps to reproduce
Use the MRP below, or:
Minimal reproduction project
broken_animation_tree.zip
The default scene has everything set up, just run it and use the arrow keys to try to play different animations
Only
ui_right
andui_down
will work, as they are transitions between the "idle" state and the "move_group" state, both which are on the same AnimationNodeStateMachine.ui_up
andui_left
which are transitions from "idle" directly to AnimationNodeAnimations inside the "move_group" AnimationNodeStateMachine, will not work, even though they'll print that the transition is valid (when you are coming from idle)The text was updated successfully, but these errors were encountered: