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
Godot v4.3.dev6 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 Ti (NVIDIA; 31.0.15.5222) - Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 Threads)
Issue description
An AnimationTree with a state machine and only two states/animations that use transitions with advance_mode set to "auto", will report a "_transition_to_next_recursive" warning if the advance_expression allows transition, even if the switch_mode is set to "At End".
Going from "idle" to "fire" happens when the advance_expression of triggered evaluates to true. This is driven by a simple button press in the UI:
Going from "fire" back to "idle" uses the expression not triggered or automatic.
If automatic is true, this results in "automatic fire", continuously switching between the "idle" and "fire" states/animations, and works as expected.
W 0:00:02:0237 _transition_to_next_recursive: AnimationNodeStateMachinePlayback: parameters/playback aborts the transition by detecting one or more looped transitions in the same frame to prevent to infinity loop. You may need to check the transition settings.
<C++ Source> scene/animation/animation_node_state_machine.cpp:909 @ _transition_to_next_recursive()
It seems the recursion detection doesn't take the switch_mode "At End" into consideration.
The issue can be "worked around" by introducing an intermediate state/animation ("trigger") and updating the advance_mode for the transitions to use that one instead:
It also doesn't occur if the idle transition is set to "At End":
However, that means the "idle" animation has to be very short for it not to delay the switch back to "fire".
The MRP is setup to reproduce the issue. Hold down the "fire" button (brief button presses will not trigger it in 4.2.2-rc3 and later) to see the warning
The MRP sets up a minimal AnimationTree state machine entirely controlled by the transitions' advance_expression.
The transitions' advance_mode is always set to "auto".
It's a firing mechanism for a gun, using triggered and automatic properties as part of the advance_expression.
The state machine defaults to the "idle" state/animation, until the triggered property results in a transition to the "fire" state/animation.
If the trigger is released or automatic is true, the state will transition back to "idle".
Holding down the "fire" button in the UI will repeatedly print "pew pew".
This functionally works but results in a _transition_to_next_recursive warning printed by Godot starting with 4.1.1-rc1.
A change introduced in 4.2.2-rc3 results in the warning only if the button is pressed for longer.
The text was updated successfully, but these errors were encountered:
Tested versions
I've tested the following Godot version:
System information
Godot v4.3.dev6 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 Ti (NVIDIA; 31.0.15.5222) - Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 Threads)
Issue description
An
AnimationTree
with a state machine and only two states/animations that use transitions withadvance_mode
set to "auto", will report a "_transition_to_next_recursive" warning if theadvance_expression
allows transition, even if theswitch_mode
is set to "At End".Going from "idle" to "fire" happens when the
advance_expression
oftriggered
evaluates to true. This is driven by a simple button press in the UI:Going from "fire" back to "idle" uses the expression
not triggered or automatic
.If
automatic
is true, this results in "automatic fire", continuously switching between the "idle" and "fire" states/animations, and works as expected.Godot still prints the warning:
This was originally introduced by PR 79141: Fix infinite loop state check in
AnimationStateMachine
in 4.1.1-rc1 and would print an immediate warning.PR 89575: Move the line of infinity loop checking in AnimationStateMachine added in 4.2.2-rc3 modified the behavior, and the warning is only printed if the button is held down.
It seems the recursion detection doesn't take the
switch_mode
"At End" into consideration.The issue can be "worked around" by introducing an intermediate state/animation ("trigger") and updating the
advance_mode
for the transitions to use that one instead:It also doesn't occur if the idle transition is set to "At End":
However, that means the "idle" animation has to be very short for it not to delay the switch back to "fire".
Previous related issues:
switch_mode = at_end
#82935: Spurious animation transition warning: "aborts the transition by detecting one or more looped" forswitch_mode = at_end
Steps to reproduce
The MRP is setup to reproduce the issue. Hold down the "fire" button (brief button presses will not trigger it in 4.2.2-rc3 and later) to see the warning
Minimal reproduction project (MRP)
The MRP repository: animation_tree_transition_issue.
The MRP sets up a minimal
AnimationTree
state machine entirely controlled by the transitions'advance_expression
.The transitions'
advance_mode
is always set to "auto".It's a firing mechanism for a gun, using
triggered
andautomatic
properties as part of theadvance_expression
.The state machine defaults to the "idle" state/animation, until the
triggered
property results in a transition to the "fire" state/animation.If the trigger is released or
automatic
istrue
, the state will transition back to "idle".Holding down the "fire" button in the UI will repeatedly print "pew pew".
This functionally works but results in a
_transition_to_next_recursive
warning printed by Godot starting with 4.1.1-rc1.A change introduced in 4.2.2-rc3 results in the warning only if the button is pressed for longer.
The text was updated successfully, but these errors were encountered: