Help getting text boxes to change during scene changes

Hi!
The game I’m building is heavily reliant on changing scenes, so I have lots of “continue” and “done” buttons.
Right now I am able to make a text box say something when a button is pushed using the
MyText.GetComponent().text = " " command.

I would love for the text box to change when the scene loads, but do not know how to do this without making a button on the screen I want the text to be on.

I tried putting the code with the previous screen’s “next” button, but that does not work as the GameObject is in a different screen.

Any help would be greatly appreciated!

Possible routes to success:

  • have a portion of your UI that persists always (via DontDestroyOnLoad marking), such as a loading message or status message

  • only unload certain scenes rather than simply loading a fresh scene. This is broadly called additive scene loading.

Additive scene loading is one possible solution:

A multi-scene loader thingy:

My typical Scene Loader:

Other notes on additive scene loading:

Timing of scene loading:

Also, if something exists only in one scene, DO NOT MAKE A PREFAB out of it. It’s a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.

Two similar examples of checking if everything is ready to go: