0 votes

In my main-scene I create some viewports with games in them.
I also save the games in a dictionary in the global-file.
When the games are over I want to show a Leaderboard-scene, but when I change the scene my viewports inclusive the games are empty.

How can I solve this?
Ty for helping in advance:)

Godot version 3.3.2
in Engine by (64 points)

cant really help if theres no code

1 Answer

0 votes

You could try using an Autoload to store the necessary variables across scene changes.

I don't know how you are changing scenes, but instead of replacing the entire scene you could have a root node that has a function to swap out child nodes to change the scene the user can view. In this way you wouldn't "lose" all the scenes that were loaded because you would only be changing some of them.

For example, your scene tree may look like

- Root
  - SomeNode
  - World
      - children

And you would swap out the children of World but keep other nodes loaded.

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