When I am in the game and change the scene, the click field isn’t carried to the new scene.
This is an example of one of the buttons. When I change to a different scene in game, this field is empty. I wanted to know if there was a way to assign that field in script when it’s loaded.
Edit: It seems the image isn’t showing here. What I’m trying to show is the OnClick box inside the button component and the feilds inside when a new index is added.
I’m not having a problem with actually changing the scene. It’s all my buttons that don’t contain an input after I load a new scene. The button is also part of a Prefab.
The button itself persists and all the indexes in the OnClick array persist, it’s just that the field in each of index’s boxes are empty. It shows the words “Missing (Object)” in the field where I would add the game object that contains the script.
This means that the GameObject that this script instance is connected to no longer exists.
Before changing scenes, click on that field so you can tell which object it is in the scene, then rename that object to something else, change scenes and you’ll see it is gone.
I’ve been trying to do what you said, I press play, change the name of the GameObject (which is a prefab), then press the button that changes to a new scene. But the name is still the same in the new scene. I use some code to identify whether the instance of the script is the same as what it should be.