Quantcast
Channel: Answers by "podmaster"
Viewing all articles
Browse latest Browse all 30

Answer by podmaster

$
0
0
You can do: Application.LoadLevel (Destination); //FOR EXAMPLE Application.LoadLevel ("PlayScene2"); Remember, in order for this to work you must open the file > build setting and drag and drop the scenes you are gonna use into the build settings. REF: http://docs.unity3d.com/ScriptReference/Application.LoadLevel.html //EDIT// BTW what i do is create this simple script: //LOAD LEVEL SCRIPT #pragma strict var Destination : String; function LoadScene () { Application.LoadLevel (Destination); } Attach it to the button that loads levels and on the inspecter type in the desire scene destination, then add an event to the button component and use the button it self to execute the LoadScene() function. Here is another answer about this topic: http://answers.unity3d.com/questions/777818/46-ui-calling-function-on-button-click-via-script.html //EDIT// HOW TO DO IT 1.select you button, on the inspector you must have a "button" component if not add it. 2.Then drag and drop the object with the loadlevel script 3.Select the script > function() and when the button gets clicked or taped the selected function will be executed. http://answers.unity3d.com/storage/temp/37098-untitled-1.jpg ![alt text][1] [1]: /storage/temp/37098-untitled-1.jpg I recommend you to watch this video shows everything you need to know (Almost) https://www.youtube.com/watch?v=EOX6itCuKOc

Viewing all articles
Browse latest Browse all 30

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>