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
1
Question by dnadevelopers · Aug 22, 2014 at 09:25 PM · androidscenenot workingloadlevelapplication

Application.Loadlevel("Level Name"); not working on android

Hello all. I'm making a simple android game. I need to change scene when the screen is touched. It works ok on the PC with a click, but it doesn't work on android. I have already seen some questions with the same problem but none of them had a working answer. The code I am using is:

 if (Input.touchCount == 1){
 
     Touch touch = Input.touches[0];
 
         if(touch.phase==TouchPhase.Began){
                 
                Application.LoadLevel("Level Name");
     
         }
 }

Do you have any suggestions?

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

2 Replies

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

Answer by TrivialRoo · Aug 23, 2014 at 04:35 PM

Ah. I had this same problem. I think the solution that worked for me was when you build to Android you UNCHECK Split Application Binary. Google Play DOES still allow you to submit to the Play store without split application binaries so you're good there. I think it has something to do with the interaction between the two binaries when Unity builds.

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 dnadevelopers · Aug 23, 2014 at 04:54 PM 0
Share

thank you!!!!!! It finally works!!!

avatar image
0

Answer by Petrol · Aug 23, 2014 at 01:04 AM

I tried your code in my android project and it was working fine.

Are you sure you are not mispelling your "Level Name" ? The string is case sensitive so "level name" and "Level Name" (or whatever the real name is) are not equals.

Also be sure you added the level you want to load in your build settings : Load the scene in the editor then in Edit->Build Settings : click on "Add Current"

You can check this link :

http://docs.unity3d.com/ScriptReference/Application.LoadLevel.html

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 dnadevelopers · Aug 23, 2014 at 02:00 PM 0
Share

The level is added on build settings and its spelled correctly. It works great in The ediyor, but on android it doesnt work. Only Application.Quit(); works.

avatar image Detinator10 · Aug 23, 2014 at 03:19 PM 0
Share

add some debug.logs or prints so you can see whether it's that the touch isn't working or if it's really the level loading not working

avatar image dnadevelopers · Aug 23, 2014 at 03:51 PM 0
Share

I don't think it's the touch that's the problem, because Application.Quit(); works. I think the problem is in the LoadLevel part

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Application.LoadLevel Strange Problem 2 Answers

How to create a complicated game over scene ? Help 1 Answer

What API lvl to use? 0 Answers

How to load a level after 30 seconds? 3 Answers

Application.LoadLevel() doesn't clear screen 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