This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

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!

in Engine by (29 points)

1 Answer

0 votes

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.

by (1,003 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.