Make object active only once
Hello guys! I need some help! I am new to unity and i have created a project with 2 scenes. The thing is that i have made some canvas that i need to be opened when i change scenes but only for one time. To be exact, i need the first to open only on start up, then when i change to the main game i need the other canvas to appear for one time. And then when i change back to scene 1, i dont want the first canvas to appear again! Any help guys? Please? Thanks in advance!
easy solution: create a static Boolean which you set true after the first time you loaded the scene.
put that variable in a script on the canvas and check prior to setting it if it's true and if so, destroy the whole gameobject. or just keep it disabled and only enable it if false.
more complex: make the canvas a prefab and load it on startup if it's needed and not otherwise
I will try the first solution and will get back to you! How to i load a prefab only on startup? Can you explain? Because i may need to used it elsewhere and it would be good to know!