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 /
This question was closed Jul 10, 2020 at 12:06 PM by HoshiHoshi for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by HoshiHoshi · Sep 03, 2013 at 11:03 AM · loadlevel

[Closed] My level load code isnt working

I'm very new to unity so it's probably my error but this script isn't working and I can't see why it isn't working. I don't get an error just when I go in game and click the object nothing happens.

 function OnMouseUP ()
 {
 Application.LoadLevel ("1");
 }
 
 

That's the whole code.

Thanks for helping

Comment
Add comment · Show 1
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 fafase · Sep 03, 2013 at 04:17 PM 1
Share

On$$anonymous$$ouseUP -> On$$anonymous$$ouseUp

4 Replies

  • Sort: 
avatar image
0
Best Answer

Answer by HoshiHoshi · Sep 04, 2013 at 07:30 PM

Thanks fafase works perfectly now!

Comment
Add comment · 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
3

Answer by meat5000 · Sep 03, 2013 at 11:03 AM

Call load level by index like this

 Application.LoadLevel (1);

Using "" looks for a level named 1.

You also need to add the scene you wish to include in the Build Settings.

Comment
Add comment · Show 2 · 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 HoshiHoshi · Sep 03, 2013 at 04:15 PM 0
Share

I've done all that and it still doesn't work

avatar image meat5000 ♦ · Sep 04, 2013 at 02:21 AM 0
Share

fafase has spotted it.

avatar image
1

Answer by DeveshPandey · Sep 03, 2013 at 11:51 AM

First of all you have to add your scenes to Build Setting -

1). Press CTRL+SHIFT+B for Windows & CMD+SHIFT+B for Mac

2). Drag and Drop your scene to "Scenes in build", you can see your index number in right side of Build Setting window

You can load your scene by two way -

 Application.LoadLevel (1);

Where 1 is the index number of your scene listed in Build Setting

 Application.LoadLevel ("Scene1");

Where Scene1 is the name of scene, you can see this name in your build setting or project view.

Comment
Add comment · Show 3 · 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 HoshiHoshi · Sep 03, 2013 at 04:12 PM 0
Share

I've done all that it still doesn't work.

avatar image DeveshPandey · Sep 04, 2013 at 04:58 AM 0
Share

Can you show me your code?

avatar image HoshiHoshi · Sep 05, 2013 at 05:57 PM 0
Share

its now working fafase got it. I had a capital P

avatar image
0

Answer by FrankStarsKo · Sep 04, 2013 at 02:23 AM

i think what you need is this:

 function Update() 
 {
         if(Input.GetMouseButtonDown(0)) // waiting button left to be pressed
         {
             // Application.LoadLevel (1); 
             // Just comment out any of these
             // Application.LoadLevel ("Level Name Goes Here as string");
         }
 }
Comment
Add comment · 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

Follow this Question

Answers Answers and Comments

19 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 avatar image avatar image

Related Questions

Wait n-seconds before loading level 1 Answer

spawn position after application.loadlevel 2 Answers

Using LoadLevelAsync to load a level in the background , but initiate the level changing after something is done 1 Answer

Load last scene/level 4 Answers

Destroy vs Don't Destroy 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