Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

DontDestroyOnLoad with object on another scene

$
0
0
So I have an Options UI on my main menu and a pause UI on my level1. I want to make it so when I press the back button, it will go to my pause menu. That currently doesnt work. right now I am using "GameObject.Find("pause").SetActive(true);" and it isnt working I get an error saying: "NullReferenceException: Object reference not set to an instance of an object optionsprompt.BackButton (UnityEngine.Object myObject) (at Assets/optionsprompt.cs:67)" line 67 is the code I showed. Why is this happening and is there a better way of doing this?

Viewing all articles
Browse latest Browse all 416

Trending Articles