Using a Silbing in an AnimationPlayer?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By brangho

Hey :smiley:

Does anyony know, why the AnimationPlayer of a sprite(Sprite1) can also handle another node (Sprite2), which is a sibling to Sprite1?

Structure:
_ Root
_ _ Sprite1
_ _ _ AnimationPlayer
_ _ Sprite2

It seems, that I don’t understand the concept of the AnimationPlayer.
I assume, that here in the docs lies the solution, but I don’t understand it.
Could someone give other sources of explanation or break it down for me, please? :smiley:

:bust_in_silhouette: Reply From: Bubu

An AnimationPlayer node can animate almost any property of any node, regardless of the hierarchical position in the node tree. So adding an AnimationPlayer as a child of a Sprite node doesn’t make any difference.

Thanks :smiley:
So I could technically let the root be the AnimationsPlayer?

brangho | 2021-05-07 11:50

Well, you can. A good practice is to add an AnimationPlayer node as a child of the root node and add the animated nodes as children of the AnimationPlayer to easily keep track of the animated nodes.

Bubu | 2021-05-09 15:10