Godot Version
v4.6.stable.official
Question
So I’m updating my game from v4.1.4.stable.official to v4.6.stable.official. My game character can attack while moving, so in order to allow the weapon swing animation to only play on the upper body as the legs continue playing the running animation, I set up a system where in-script I duplicate the imported model’s AnimationPlayer and delete the lower body tracks from the weapon-swinging animations. This worked completely fine in v4.1.4, but in v4.6 the lower body tracks for said animations aren’t succesfully removed - when my character swings their weapon, their lower body locks up rather than allowing the running animation to play.
As far as I can tell, the problem is that find_track can’t find said lower-body tracks. However, when I check the imported node, they’re there. I’m at a complete loss for what to do here, any help would be appriciated. If more info is needed I’m happy to show and explain.
(As can be seen, the original model files are .glb files, exported from Blender. model.glb is the character’s model.)
Beyond the problem you describe, I think could be more useful if you use masks in an AnimationTree and mix locomotion and action
I recognize AnimationTree would help but I’m hoping there’s a solution that doesn’t involve a total rework of the system, for my own sanity
I understand your point but think about this. You wrote in code the logic implemented as part of the AniamtionTree forcing you to maintain it instead of just configuring it.
I will recommend you to backup your project and give it a try. AnimationTree has a lot of advantages as reuse among models.
Does AnimationTree allow me to have one animation freely play, and then allow me to seamlessly play a second animation on top of it whenever i want without interrupting the first animation?
Yes, you can be playing running state and oneshoot fire animation using a Mask and will only be applied as configured.
In the example, while the state is running, OneShoot will start OpenDoor animation masked to the upper part of the body:
How does that work? Am I able to set it up so that whenever I call a certain animation it layers it on top of the already-playing animation? I want to be able to have the weapon swing animation to be able to start part-way through a running animation and for the weapon swing to seamlessly continue running even if the running animation stops and changes to a climbing animation, like this:
Yes, Masks allow you do that. On the nodes you can set them under the Edit button
They allow you to do this dynamically? How do I, in script, stop just the run animation vs. just the weapon swing animation when both are being played at once?
For the OneShot, the animation stops when ends, usually a shooting animation do not loops, so, while the walk or climb animation is running, you start the shoot and while running will blend based on mask settings and when the shoot animation ends will continue with the walk
If I were to start the swing animation again, such as when using a weapon very quickly, would it stop the existing OneShot so that the new one can start?
You can abort the execution, yes