-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Variable with setter gets set every frame when keyframe of it exists and animation player is linked to a state machine animation tree #98174
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Okay thank you for clarifying (you didn't mention it) reopening for testing |
Sorry for not mentioning it, I hadn't considered that part of the issue. |
The animation tree isn't really set up to do anything so it is unclear what is supposed to happen here, but if you change the callback mode in the tree to something other than "Force Discrete" it works correctly |
My tree does not have a "Force Discrete" rather it has "Force Continous", "Dominant", and "Recessive". Switching off "Force Continous" does fix the issue as you said. However I would like to know if this is intended behavior. |
My bad meant "Force Continuous" Not sure what's intended here, or how it would be handled when adding a real use case for the tree |
Well as I said in my issue description, I stumbled across this issue with an actual tree that had state machines and states inside of it. In that case I have three variables that are altered by animations. Setting the tree callback to dominant or recessive causes only one ( the same one) to update constantly. I can attempt to make a MRP of that whole scene but it might take a while finding what breaks the behavior and what doesn't. |
Not sure what is to be expected there, or how to solve it, let's see what the animation team says CC @TokageItLab |
Tested versions
System information
Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 (NVIDIA; 32.0.15.6094) - 13th Gen Intel(R) Core(TM) i7-13700KF (24 Threads)
Issue description
I originally stumbled across this issue trying to set enums during attack animations in another project. I'm fairly certain this is a bug. If you create a variable with a setter, create an animation with a keyframe of that variable, and link that animation player to an animation tree with root of a state machine, then that variable will be set every frame. Nothing even has to be inside the animation tree, it just happens.
Steps to reproduce
Create a new 3D Scene with Node3D as the root.
Create a script and exported variable of type int for the Node3D.
Add a set(): to the variable and put a print in there.
Add an animation player as a child of the Node3D and create an animation that has a property track for the variable and insert at least one keyframe.
Add an animation tree as a child as the Node3D and set its root to a state machine and set the animation player to the one created.
Run the project, and you will see constant prints in the output, despite the animation not even playing.
Minimal reproduction project (MRP)
Here's the MRP.
anim_tree-test - Copy.zip
The text was updated successfully, but these errors were encountered: