Godot Version
4.3.1
Question
I am having trouble with animations synchronizing on their own when I follow the steps below.
- Create scene “A” whitch includes animationplayer node.
- Instantiate “A” into other scene.
- Instantiate “A” again as child node of the previous “A”.
- Then the animations of two “A” somehow synchronize.
- After this, no matter how many “A”'s I instantiate, they all synchronize, even if it is not a child node.
Furthermore, when I delete the first “A”, all tracks of animation are lost for some reason.This will give the following warning message: Delete node “A” Some nodes are referenced by animation tracks.
I like instantiate from the file system, but I am having trouble with accidentally instantiating consecutive, which results in a child node and cause this problem.
Is this a bug or a specification?
I would like to know how to restore a scene that has been synchronized or way to prevent it from being synchronized.
Do you refer to nodes with unique-names inside the animation-player?
"A” is a 2D node with AnimationPlayer as a child node. It is scripted to play three different animations depending on the situation.
This AnimationPlayer does not use the built-in library, but loads an externally saved library, “A.res”.
And what does this animation do?
Frankly speaking, it is Mario’s block.
The player character hits it from below, which plays “destroyed” animation.
However, the problem is that when player hit one “A” block, all of them play the destruction animation at the same time.
Can you show the code where you call this animation?
Sorry, I can’t show you the code due to some reasons.
However, this problem does not occur if the same “A” is placed as a regular node, not as a child node.
Once “A” is placed as a child node of “A”, the problem occurs permanently.
So I wanted to know if there is a solution, thinking that the cause is due to the Godot Editor’s specifications, not the code.
Do you use unique-names on any of the nodes in the scene?
Only “A”, the player character, and the ground collision are placed in the scene to which they are placed.
“A” is named “A1” and “A2” because multiple “A”'s are to be instantiation placed.
In the “A” scene, there is only Sprite2D, AnimationPlayer and collision. Their names are left as default.
So if its not a child you dont have this problem?
yes, this problem occurs only when it is set to child.
And once it occurs, it occurs even if it is set as if it is not a child.
So can you just not add it as child of each other?
Yes, it is a problem that can be avoided if I am careful.
However, once it occurs, the project must be rolled back, and it can easily occur just by doing instantiation in a row.
What properties do you animate?
Oh, sorry, “A” also had GPUparticle2D.
The “destroy” is a simple 0.5sec animation that reduces the transparency of Sprite2D and emit ON the GPUparticle2D dots of debris flying.
do you use the transparency of “modulate” or “self_modulate”? modulate also applies to child nodes, so you probably want to use self-modulate
Yes I’m using self-modulate.
Without more information i cant really help you. Behaviour like this normally is because of a resource being shared and somehow changed, leading to every instance with this resource to recieve this change in the resource
1 Like
Thank you for your sincere answer.
I’ll try to figure it out myself.