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
2
Question by gargaduk · Sep 15, 2013 at 08:28 PM · androidbuttonsceneloadleveltablet

Android: Scene change (Application.LoadLevel) has no effect

I made a game which is now stuck in the reviewing process of Samsung Apps.

If I'm testing it on Windows everything works fine, but on some Samsung Tablets this thing keeps happening:

The GUI.Buttons in the level selection won't work. All it should do is change the scene. The command I used is Application.LoadLevel(Level); The game doesn't freeze or anything, it just has no effect if the button is pressed.

It's my first game on Android, so I have no idea what could be wrong or if there are some hidden error messages I didn't see. I'm hoping for a quick answer with a possible solution or workaround, as I have not much time left until the game's release will be announced. Thanks!

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 Bloodyem · Sep 16, 2013 at 05:29 AM 0
Share

It's a bit hard to say without seeing the code, but are you completely sure the button itself is set up correctly?

avatar image ODNSEV7N · Sep 16, 2013 at 08:19 AM 0
Share

Application.LoadLevel("Name of level"); might work.

or..

  function LoadLevel(levelName: String){
    
     Application.LoadLevel(levelName);
 }

 

Then call this function on the button press with the name of level you want.

   LoadLevel("Name of level");



I think it maybe doing nothing as you have not told unity what level to load. (I think).

Tim.

avatar image gargaduk · Sep 17, 2013 at 09:20 AM 0
Share

Thanks for the answers!

I don't think the mistake is in the code, because it works on every device except some samsung tablets. Here is what I do:

 if (GUI.Button (Rect (myWidth/3.84 + $$anonymous$$odulo_i*GapX, myHeight/6.72 + DivideForLine*GapY, myWidth/10.8, myHeight/6.6), ""+(i+1), StyleLevelSelection)) {
     Application.LoadLevel(i+1);
 }


So there is a button (and later a many of them arranged in rows), which is drawn correctly and which should lead to a specfic level. The "i" in Application.LoadLevel(i+1); is an integer which represents the number of the level. So for example on the button for Level 1 it will do this: Application.LoadLevel(0+1);, which will load Level 1.

As said this works perfectly if tested in the editor, so I guess there is a problem with loading levels on Samsung devices, but I have no clue what it could be.

avatar image Graham-Dunnett ♦♦ · Sep 17, 2013 at 02:59 PM 0
Share

Add a Debug.Log() before the LoadLevel line so you can be sure that the Button has been pressed.

avatar image gargaduk · Sep 18, 2013 at 03:33 PM 0
Share

I managed to look at the log files of the device. The button works but there is an error message:

09-18 15:22:46.416: E/Unity(17470): Level '' (1) couldn't be loaded because it has not been added to the build settings.

The Levels (in this case Level 1) are however correctly placed in the build settings of the editor...

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by Akelator · Oct 01, 2014 at 08:14 PM

This is not a pro-answer but it works for me.

  • Export the proyect and all assets as new package.

  • Create new proyect.

  • Import the package in the new proyect.

  • Drag the scenes in build settings and put them in the correct position.

  • Build the new proyect for android.

  • Fixed! :)

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 tanoshimi · Oct 02, 2013 at 06:13 AM

Is "i" being initialised correctly? (it's not shown in your code snippet) What happens if you hardcode the call to Application.LoadLevel(1); rather than Application.LoadLevel(i+1); ?

Do you have other levels apart from your level selection screen and level 1? If so, try changing their order around in the build settings or rename them to see if there's any problem affecting only your current level 1.

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 liortal · Jan 05, 2015 at 01:58 AM

9-18 15:22:46.416: E/Unity(17470): Level '' (1) couldn't be loaded because it has not been added to the build settings.

This error happens when you forget to check a new scene in build settings.

Go to your build settings in the editor (File->Build Settings) Make sure that all scenes that you attempt to load at runtime are checked (have a V next to them).

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

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

Related Questions

Changing scene with button android 1 Answer

Application.LoadLevel Strange Problem 2 Answers

how do i use GUI buttons with a android device(tablet) 2 Answers

Touch button to load scene, instead of touching anywhere on screen 1 Answer

LoadLevel easy i know, but not working. 1 Answer


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