Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Adhordal · Jul 04, 2015 at 02:18 AM · bug-perhapslevelload

Application.LoadLevel always loads level 0

I am having a problem with my scene changing script. My game is almost finished except for a problem which i cannot seem to solve. My game has a Main Menu scene which holds a terrain and a canvas with buttons. The "Start Game" button references a script on the button itself, and calls a function upon click: function ChangeScene () { Application.LoadLevel("GOODSECOND"); }

Whenever I click it is supposed to load the second level. But it always results in reloading the main menu level. I tried using LoadLevel(1) as well. This appears to be happening only with the level 1 & 2. Setting LoadLevel to 3 or 4 works fine. This made me believe it was the other scenes fault. I tried copying everything to new scenes in case they were corrupted but no luck in that. This also happens when you try to load level 2 from level 1, it load level 0.

Has anyone experienced this before? Can someone please help me with it? It is holding back the game from being finished.

Comment
Add comment · Show 7
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 ♦ · Jul 03, 2015 at 10:29 PM 0
Share

Diiiiiid you add the scenes to build settings?

avatar image Adhordal · Jul 03, 2015 at 11:02 PM 0
Share

Yes, they are there. I should have mentioned that in the description.

avatar image Adhordal · Jul 04, 2015 at 05:17 PM 0
Share

I just placed the Debug.Log on awake and indeed, level 1 is loaded then level 0 is loaded immediately. It appears i might have to do a check on every script in the level.

avatar image Adhordal · Jul 04, 2015 at 05:38 PM 0
Share

Thank you! I just checked all the scripts in the second level and found the culprit, which was a function that calls another function which says load level 0, at function Start() Thanks

avatar image Lo0NuhtiK · Jul 04, 2015 at 05:55 PM 0
Share

@Adhordal : You marked @s.ta.c. 's answer as correct, but if @meat5000 comment is the actual solution the comment can be converted to an answer so you can mark it as accepted ins$$anonymous$$d.

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by meat5000 · Jul 04, 2015 at 02:30 AM

Are the other scenes somehow firing another LoadLevel, taking you back to 0?

Put a Debug.Log in the Awake() function somewhere in levels 1 and 2 so you can see if its being loaded and destroyed by another scene.

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
1
Wiki

Answer by starikcetin · Jul 04, 2015 at 02:24 AM

Your codes may be going in a loop, may be a function triggers something that you don't expect to be triggered. That's all i can say with this type of question that has no code piece or screenshots.

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
0

Answer by W.Walter · Jul 04, 2015 at 02:24 AM

Check your build settings again, and the actual scenes they represent. There is no reason for this 'bug' other than a stupid mistake.

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

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

6 People are following this question.

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

Related Questions

Help With Level Load 1 Answer

Unity capturing events in editor and not letting go 0 Answers

UnusedBytecodeStripper2.exe did not run properly when building with 5.3.0 1 Answer

Unity Builds Old Version of my Scene 1 Answer

How to keep Google Play Services constantly signed in 0 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