Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation Freezes When Played for First Time & AnimationTree Transition Does Not Work When Animation is Looping #95346

Open
valkyrienyanko opened this issue Aug 10, 2024 · 2 comments

Comments

@valkyrienyanko
Copy link

valkyrienyanko commented Aug 10, 2024

Tested versions

Tested in Godot 4.2 stable and v4.3.rc3.mono.official [03afb92]

System information

Windows 11, Gpu RX 6600, Cpu 10400, Godot v4.3.rc3.mono.official [03afb92]

Issue description

  • Animations do not play if looping is enabled for the rest animations
  • There is a freeze that occurs just after playing the reload animation for the first time (more info on this below)
MRP.Video.mp4

Steps to reproduce

  1. Open up the attached MRP.

There will be 2 AnimationPlayer nodes. Currently the "arms_rest" and "assault_rifle_rest" are not set to be looping. We will get back to this later.

  1. Play the game with F5.

Immediately press R to play the reload animation. Part of the animation will freeze for the first time playing but will not freeze after that. You should see the reload animation play on repeat.

Some observations about the freeze.

  • Only the weapon animation freezes, the entire game did not freeze
  • If you wait 10 seconds before playing the weapon reload animation then there will be no freezing to begin with
  • The freeze happens every time the game starts up

This warning will appear in the console.

W 0:00:04:0825   _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:918 @ _transition_to_next_recursive()
  1. Close the game and set the "arms_rest" and "assault_rifle_rest" animations to be looping by clicking the looping icon in each AnimationPlayer node.

Untitled

  1. Play the game again with F5

Press R to play the reload animation and notice how the animations will not play at all. The same warning that appeared in console will appear again.

Minimal reproduction project (MRP)

MRP is 27 mb and GitHub upload limit is 25 mb so MRP was uploaded to MediaFire.

https://www.mediafire.com/file/3e7p575esehewe1/MRP_AnimationTest.zip/file

@valkyrienyanko
Copy link
Author

valkyrienyanko commented Aug 10, 2024

All thanks to sapulha_dakgen in the Godot Cafe Discord I was able to get both issues resolved.

(1) The freezing / animations not playing issue can be resolved by removing the "Autoplay on Load" from both idle rest animations.

(2) The warning in console can be resolved by setting the reload condition back to false when the reload animation is done playing.

I don't know if (1) is because of a bug in the Godot engine. If it is not a bug then maybe a warning could be shown saying "Using the Autoplay on Load flag while trying to transition from a looped animation will not transition unless you remove the Autoplay on Load flag".

I feel the warning in (2) could use a better description. Something like "You may have forgot to exit the animation. Try setting your condition back to false to exit this animation"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants