0 votes

How do i unhide/show a node that is in another scene? After the player completed a level I want something to appear in another scene, but I can't figure out how. Does anybody know the answer?

in Engine by (15 points)

Look into singletons and signals.

Make an autoload script and put in the signal you want to react to. Emit that signal when the player completed the level. In the other scene, connect to that signal with the name of the method that changes the visibility of the thing you want to show.

1 Answer

0 votes

It depends what you want.

If you mean, "Level is done, go back to the previous scene and continue my script", then you want to use a signal and a yield statement. In your level.gd, you declare something like signal EndLevel and emit_signal("EndLevel"). In your main scene, you mightyield(levelthing, "EndLevel")` or you might connect the EndLevel signal to some routine which gets called when the signal is emitted.

If you are wanting to update a player record, you might look at singletons.

by (335 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.