- Home /
Load a Level on Touch
I am new bee in Unity, so please forgive me my silly question. Actually i want to load a Scene while running app. I wrote following code to load scene when i touch texture.
{function Start()
} function Update() { var hit : GUILayer = Camera.main.GetComponent(GUILayer); var hitObject : GUIElement = hit.HitTest( Input.mousePosition ); if( hitObject != null ) { switch( hitObject.name ) { case "HowToButton": print("Touch On How To button"); print("Load Level Name :"+ Application.loadedLevelName); //Application.LoadLevelAdditive ("HowTo"); Application.LoadLevel("HowTo"); break; default: break; } } } So when i run on device(iPhone), i couldn't load HowTo screen and give me this message. "Level 'HowTo' (-1) couldn't be loaded because it has not been added to the build settings. To add a level to the build settings use the menu File->Build Settings..." I also added this into scene, but i don't where i am doing wrong. Please help me. Thanks in Advance.
Answer by Fattie · Nov 13, 2012 at 08:36 AM
Salaam , Fortunately, the answer is very simple ...
Look in menu File. Open the Build Settings.
You must drag all the scenes you need to that area. Here's a picture...
http://docs.unity3d.com/Documentation/Manual/PublishingBuilds.html
Hope it helps. Cheers!
Thanks Fattie, I already added Current Scene so this view is in my current scene. I don't know how it'll work.
could it be you have to add the "HowTo" scene ??
do not hesitate to ask more and post images of what your settings look like
Your answer
Follow this Question
Related Questions
Optimize my game? 2 Answers
Game running on android but not in iphone 0 Answers
How to embed unity ios project with another ios project 0 Answers
Missing Push Notification Entitlement issue in Unity3d 2 Answers
Cloud recognition in Vuforia 0 Answers