Hello,
I am trying to create a “Back” button for my in-game login menu. The way it works so far is this: Menu > “Login” or “Update”
If you clicked “Login”, it will do “Instantiate(LoginPrefab)”; if you clicked “Update”, it will do “Instantiate(UpdatePrefab)”. Simple.
I need a back button for both instantiated prefabs that will destroy the current instantiated prefab and then send the message “ActivateMenu, true” to a script called “crMenuScript.js” that is in the “Menu” prefab, the one where my menu runs from. ActivateMenu lets me use the menu again.
I’ve done multiple tests, but I can only destroy the instantiated prefab. I always get a “NullReferenceException” when trying to access “crMenuScript” from another prefab.
Forgive me for the newbish post, but I have tried everything I could do and find over the past couple weeks. All of Unity’s scripting reference pages could not help me (perhaps I was using the scripts the wrong way).
Thank you very much,
TheCyberMan
P.S. I would prefer this to be in Javascript, but I just need guidance on getting this to work. I could translate the language to Javascript later if need be.