Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by PaxStyle · Aug 23, 2013 at 03:48 PM · sceneloadlevel

Load Scene

Hi! I use this code to load the second scene, but not work. In firts scene there is a simple presentation video, in the second scene the main menu, but this script load only the firts scene, and when the video of the firts scene is finished, it stops, and don't load the second scene (Main menu)
All two scenes are in the "Scene in Build"..

This script is attached at the firts scene. Hope you help me :/

 using UnityEngine;
 using System.Collections;
 
 
 public class CaricaScene : MonoBehaviour {
     public bool VideoStart = true;
     public bool Menu = false;
     
     
     
     void Start() 
     
     {
         VideoStart = true; 
         Menu = false;
         Screen.showCursor = false;
     }
     
     void Update () 
     {
         MethodBase opzioni = opzioni.GetCurrentMethod();
         Menu = true;
         VideoStart = false;
         
     }
     
     
     void opzioni (int id)
     {
         
         if (VideoStart) 
         {
             
             Application.LoadLevel("AidaGames");
             
             
         }
         
         
         
         if (Menu) 
         {
             
             Application.LoadLevel("MainMenu");
             
         }
         
         
         
     }
  
Comment
Add comment · Show 8
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Aug 23, 2013 at 03:55 PM 0
Share

Close your old question as this is a duplicate really. http://answers.unity3d.com/questions/522286/problem-loadlevel.html

$$anonymous$$y comment in last post:

You dont call opzioni(int id) and if you did, what is the int for?

Also as $$anonymous$$enu = true; VideoStart = false; is hardcoded to the Update() function any attempt to change these values elsewhere would be overridden by Update()

avatar image meat5000 ♦ · Aug 23, 2013 at 03:56 PM 0
Share

You have added some kind of call but I really feel you are over-complicating a very simple thing.

In your first scene make a gameObject with a script that handles the condition for the second scene load.

 if(condition == true)
 {
      Application.LoadLevel("AidaGames");
 }

As its a main menu I'm assu$$anonymous$$g you have some kind of Start button. The LoadLevel should occur when you have pressed the Start button.

I use Android so in my touch handler if the GUIText "Start" is touched -> Application.LoadLevel

avatar image PaxStyle · Aug 23, 2013 at 04:14 PM 0
Share

Hmh I have to create an empty game object in firts scene, ok.. but I don't understand which script to put... sorry but Im' beginner with script.. :/ what should I put in place of "condition"?

avatar image meat5000 ♦ · Aug 23, 2013 at 04:42 PM 0
Share

I think first you have to decide on what you want to happen/ what you need to do to trigger the load.

Do you press a button? Is it automatic after a time period?

avatar image PaxStyle · Aug 23, 2013 at 04:58 PM 0
Share

After a time period.. when the firts video is finished (during 4,5 seconds) afrter this, start the second scene.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Fabian0010 · Aug 23, 2013 at 04:42 PM

Go to build settings and add scenes. then use the numbers: Application.LoadLevel("1"); Application.LoadLevel("2"); Application.LoadLevel("...");

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PaxStyle · Aug 23, 2013 at 05:02 PM 0
Share

The scenes are yet added..

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How the scene works 1 Answer

Multiple Instances of My Current Scene? 0 Answers

Current scene number 2 Answers

How can I save the player's progress in-game? 1 Answer

What is the Difference betwwen a "Level" and a "scene" 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges