My AnimationPlayer can't find the animations if multiple instances of a scene are added to the tree

Godot Version

4.4

Question

I’m making a little animation where I want to move an play some sounds when an instantiated scene is added to the tree. The first node plays with no problem, but the second one does not. I receive some debug messages that say that the animation player can not find the path to the nodes to animate.

Looking into that I noticed that if two of this nodes happen to appear in the tree at the same time, the second one will have its name changed from “Control” to “Control@88”, for example, and this breaks the animation.

Is there a way to make the AnimationPlayer consider the nodes it have to play without taking the parents node name into account? I tried calling clear_caches() in the _ready() but it did nothing, if that was what i was supposed to use…

Here, more details:
The Scene


The animations inside the AnimationPlayer have an absolute path

The first node when added, keeps the scene name and plays Ok

If a second one appear before the previous one leaves, the name changes and the animation breaks.

The cache warnings.

The joys of writing for help after hours of meddling with the issue and finding the answer 5 minutes later.

I noticed in the inspector that the AnimationPlayer had a strange value as a Root Node:

I don’t know how that …/… appeared there, but I changed it by setting the parent node as the Root Node.

This broke the animations, but to fix them I only have to fix the path of each track by removing the name of the parent node:

Godot_UJlmHnwxdg

Now it works with no problem even with many scenes added.

Still, don’t know how that …/… value appeared there.

Sorry for the post.

1 Like