Open mrcdk opened 8 months ago
This is the intended behavior: the Transitions to Start and End in a GroupedStateMachine refer to the Transitions of the parent, so correctness for the behavior is not guaranteed if their numbers do not match. To solve this problem correctly, an implementation such as indexes to tie between ports and transitions together is required. See also https://github.com/godotengine/godot/pull/75759 description.
If the parent has only one Transition and the GroupedStateMachine has more Transitions than the parent, some consistency is guaranteed, but that would be the only exception.
If the parent has no Transitions and the GroupedStateMachine has Transitions, it will be broken because there is nothing to reference. Also, if the parent has more Transitions than GroupedStateMachine, the user cannot decide neither know which Transition will be referenced.
Uhm, I see. I think I get what you mean. So the transitions that go to and from a GroupedStateMachine need extra information like to which node to go when starting and which transition to use when ending, right? Makes sense. Right now, in my example, if I were to do travel("attack")
it wouldn't know to which node in the grouped state machine to go.
Tested versions
Reproducible in: v4.2.1.stable.arch_linux, v4.3.dev3.official [36e943b6b]
System information
Godot v4.3.dev3 - Manjaro Linux #1 SMP PREEMPT_DYNAMIC Sat Feb 10 09:40:02 UTC 2024 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU () - AMD Ryzen 9 5900HX with Radeon Graphics (16 Threads)
Issue description
When traveling into a node in an
AnimationNodeStateMachine
which type isGrouped
using the root state machine'sAnimationNodeStateMachinePlayback
a couple of warnings and errors will appear in theDebugger
tab.Root state machine:
Inner state machine
attack
(set asGrouped
):Steps to reproduce
AnimationTree
AnimationNodeStateMachine
asroot
AnimationNodeStateMachine
as a node to the other state machine and set its type toGrouped
Animation
nodes and connect theStart
node to each one. Connect eachAnimation
node to theEnd
node.In a script, using the
AnimationNodeStateMachinePlayback
of the root state machine, try traveling to a node in the inner state machine. In theDebugger
the following warnings and errors will appear:But it seems to work fine otherwise.
Minimal reproduction project (MRP)
test_grouped_state_machine.zip
It's just a
tscn
file. Pressui_accept
to toggle fromidle
toattack/cut
orattack/slash
and back.