How to access an animationPlayer part of a different scene in singleton?

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

I manage to follow the tutorial on the documentation in regards to background loading. However I cant get my loading screen animation to play because it keeps on throwing an error saying its null. I tried to use things like get_node(“/root/Scene_to_Access/AnimP”).play(“load”) but it doesn’t work and I get the null. The script runs fine without this but the grey background is shown with no animation of course. The thing is there is no indication of how the hierarchy is setup.

Is there a certain way I have to do this cause right now I have the script set in autoload and the loading screen is a separate scene.


As a means of troubleshooting, try printing the names of the root node and its children before you try to make a reference to the animation player. This should give you some idea of the hierarchy. I suspect Godot may be changing the names of the nodes in your new scene because names from the previous scene are still “tied” to the previous scene’s nodes (even if you’ve already freed them or queued them for freeing).

Diet Estus | 2018-03-30 04:59