- Home /
Question by
AnthonySturdy · Jun 08, 2015 at 10:48 AM ·
scripting problemloadlevel
How to load level then set variable in that level?
Hi, I want to load a scene, then set a variable in that scene (Like this)
Application.LoadLevel(Application.loadedLevel);
cc.hasStarted = true;
This is so the game starts right away when the scene is loaded, but it doesn't work. Is there another way to do this?
Comment
Answer by abi-kr01 · Jun 09, 2015 at 04:37 AM
make cc static bool
(if you are using it from instance)
cc.hasStarted = true;
Application.LoadLevel(Application.loadedLevel);
// this line will not execute so you have to make it true before load level
Your answer
Follow this Question
Related Questions
Cannot Get Application.LoadLevel to work 0 Answers
how to sent all players to next level(lan server) 0 Answers
Execute script when scene is visible to player 1 Answer
Need hep changing this script to a onclick script.... please help 1 Answer
Best way to defining scripts within a list inside the editor? 1 Answer