Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 lanalana · May 09, 2017 at 06:10 AM · iosvrsceneiphonescene-change

Load scene in Google VR on iOS

I'm trying to change scenes using Google Cardboard on an iPhone. I'm using

 SceneManager.LoadScene("Scene2");

In the start() function of the FPS Controller. And have

 using UnityEngine.SceneManagement;

At the top.

It works find in Unity, but when I build it on my phone, it crashes when it should load the new scene.

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 CardboardDude · May 22, 2017 at 12:54 AM 0
Share

I am experiencing the same exact problem and have submitted a bug report. Hopefully this gets fixed soon, or a solution is found.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by CardboardDude · May 25, 2017 at 02:57 PM

I submitted a bug report and was told that they fixed the problem and that it "should not appear in the upcoming 2017.1 version of Unity." I guess iOS cardboard devs will just have to wait until then.

Happy Coding,

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 Greyfaerie4 · Jun 01, 2017 at 12:36 PM 0
Share

Thanks! I have the same issue too, but I really need to switch between scenes for my project to work (it's for uni). Are there any alternatives or ways to workaround it? I just need to switch between scenes.

I tried "LoadScene" but that doesn't work either.

avatar image CardboardDude Greyfaerie4 · Jun 08, 2017 at 05:48 PM 0
Share

After some playing around it seems that loading a scene additively works fine. So the trick would be to load a scene additively and then unload the other (original) scene.

 Scene$$anonymous$$anager.LoadScene ("SecondScene", LoadScene$$anonymous$$ode.Additive);

Then subscribe to the load scene event:

 Scene$$anonymous$$anager.sceneLoaded += $$anonymous$$yScript.removeScene;


https://docs.unity3d.com/ScriptReference/Scene$$anonymous$$anagement.Scene$$anonymous$$anager-sceneLoaded.html http://answers.unity3d.com/questions/1322605/how-to-use-scenemanagersceneloaded-replacing-onlev.html

Inside the removeScene function unload the original scene:

 Scene$$anonymous$$anager.UnloadSceneAsync ("FirstScene");


So Something like this:

 public static void LoadScene(string name){
 
         Scene$$anonymous$$anager.LoadScene (name, LoadScene$$anonymous$$ode.Additive);
         Scene$$anonymous$$anager.sceneLoaded += $$anonymous$$yScript.killScene;
     }
 
 public static void killScene(Scene scene, LoadScene$$anonymous$$ode scene$$anonymous$$ode){
 
     //Scene$$anonymous$$anager.UnloadSceneAsync ("SecondScene");
        
        for(int i=0; i<Scene$$anonymous$$anager.sceneCount; i++){
              if(!Scene$$anonymous$$anager.GetSceneAt(i).name.equals(scene.name)){
                  Scene$$anonymous$$anager.UnloadSceneAsync(Scene$$anonymous$$anager.GetSceneAt(i));
                  break;
              }
       }
 }


The above functions are untested, but should give the general idea.

Happy coding and good luck.

avatar image CardboardDude Greyfaerie4 · Jun 09, 2017 at 01:16 AM 0
Share

If the approach outlined above does not work, you could also upgrade to the unity 2017.1 beta version of unity. This fixed the problem for me, however, BAC$$anonymous$$ UP YOUR PROJECT BEFORE YOU UPGRAD$$anonymous$$ Also, don't forget to downloaded the latest version of the google vr sdk.

avatar image
0

Answer by lanalana · Jun 19, 2017 at 04:36 PM

Thank you, @CardboardDude! It worked with the 2017 beta. After trying 1.6 million things, that's all it took. >_< Thanks everyone for the responses!

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

Display Activity indicator center 0 Answers

After building application on Iphone FPS Controller doesnt respond to the moving kamera, just walk straight (VR Look Walk) 0 Answers

Push Notification to start a scene 2 Answers

iPhone Virtual Reality App won't load onto my phone. 0 Answers

Unity modules for iOS? 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