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 /
  • Help Room /
avatar image
0
Question by b7b7521 · Aug 08, 2016 at 06:25 PM · unity 5vr

Run gear vr in unity instead of mobile

Hello,

i am building an application for Gear VR, my problem is that everytime i want to see the modification i did on the app in realtime, i cant view it in unity, i press play but i cant move the reticle etc... so i need to build it and run it on my mobile. This process is lame and takes time. Is there anything i can do to view the app in unity ? or am i doing anything wrong ?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by saldavonschwartz · Aug 09, 2016 at 12:57 AM

Unity's native "VR Mode" expects the device's tracking to drive the camera, so without emulating that you can't move the camera, track objects via gaze, etc.

What I do (since I also target Google Cardboard) is use the Cardboard package camera prefab, which allows emulating tracking in the editor. Then I made a menu script that allows me to choose between enabling Cardboard's vr rendering and Unity's native, and enable / disable Cardboard's tracking emulation.

Something like this:

 [MenuItem ("VRUtils/VR Mode/Cardboard")]
   static void modeCardboard () {
     PlayerSettings.virtualRealitySupported = false;
 
     viewer.VRModeEnabled = true;
     EditorUtility.SetDirty (viewer);
 
     head.trackPosition = true;
     head.trackRotation = true;
     EditorUtility.SetDirty (head);
   }
 
   [MenuItem ("VRUtils/VR Mode/GearVR - Editor (tracking enabled)")]
   static void modeGearVREditor () {
     PlayerSettings.virtualRealitySupported = false;
 
     viewer.VRModeEnabled = false;
     EditorUtility.SetDirty (viewer);
 
     head.trackPosition = true;
     head.trackRotation = true;
     EditorUtility.SetDirty (head);
   }
 
   [MenuItem ("VRUtils/VR Mode/GearVR - Build")]
   static void modeGearVRBuild () {
     PlayerSettings.virtualRealitySupported = true;
 
     viewer.VRModeEnabled = false;
     EditorUtility.SetDirty (viewer);
 
     head.trackPosition = false;
     head.trackRotation = false;
     EditorUtility.SetDirty (head);
   }


So essentially, my GearVR "editor emulation" is nothing more than no VR rendering but using Cardboard's tracking emulation.

If you are not planning on supporting Cardboard, you can still download their package and take a look at the code to see how they emulate tracking and port / adapt that section to your own script.

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

114 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 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 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 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 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

Error on building "Unable to Find Plugins folder StandaloneWindows(64): Native VR plugins will not be loaded" 2 Answers

Over Shoulder Item Change Vive 0 Answers

SteamVR Interaction - Bug 0 Answers

Detect Clicks On 3D Game Object In VR 0 Answers

Unity 5.5 to Unity 2017 - Google VR 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