Strange node behaviour?

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

I’ve been trying to use get.node() at the …/…/RichTextLabel node on the instanced …/Animation node, but I keep getting null instance errors. I have tried for example

get.node(".../AnimationPlayer").play("fade")

and

get_tree().get_root().get.node(".../AnimationPlayer").play("fade")

and that fails as well.

This is interesting because it is tied to a key input which doesn’t work here but triggers the animation when pressing keys while on the Main Menu. The animation also works fine when tested via AnimationPlayer. So dunno why it specifically refuses to trigger in this instance. I have also tried to switch to a

get_node(".../PopupPanel").popup() 

which would host a button to trigger the same animation but this causes the same null instance error.

It seems to me to be linked from the fact that I’m doing it from a …/…/Node (grandchild node??) or from the fact that AnimationPlayer is instanced though that doesn’t explain why it happened to the PopupPanel too.

Apologies for the influx of questions, this issue has probably hounded me the longest. Thanks for any advice

Code shown here!

:bust_in_silhouette: Reply From: flurick

I would try find_node() on a parent of the two nodes, avoiding breaking node paths that way.
Or using the full path if things stay where they are in the tree, as mentioned in the docs.