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
0
Question by David Lind · Nov 27, 2014 at 08:14 AM · cameraoculusfly

Oculus Fly Camera

Hi,

I have Oculus Rift and have no problems adding the standard OVRPlayerController and then being able to walk around my project.

However for some projects i need to be able to fly around instead of walk. I tried changing the OVRPlayer Controller script Gravity modifier to 0 and that seemed to disable movement (apart from head tracking). I also tried changing the gravity settings in project settings to 0 and this also seemed to disable movement. Any ideas? FYI i am new to programming.

Thanks in advance!

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 nitinmaru · Oct 29, 2015 at 11:30 AM 0
Share

HI there I can not see down side or upside in scene while walk around using OVRPlayer Controller Can you help me to solve It?

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by KoJix · Apr 22, 2015 at 09:51 AM

Hi,

In the OVRPlayerController you can found a If statement "if (!Controller.isGrounded)". If the player is in the air, so not grounded the movement will be set to 0.

You can simpely turn this statement off. So you can move when your player is in the air.

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 usagi · May 01, 2015 at 12:32 PM 0
Share

Hi,

thank you for the update!

In the meanwhile I found the solution too, and now I'm looking on how to make my camera fly according to the point of view: not only left/right or back/forward, but also up and down.

avatar image
0

Answer by usagi · Apr 03, 2015 at 07:10 AM

Hi, did you find any solution?

I have exactly the same problem and I'm looking for a solution as well. Do anyone have suggestion about how to modify the player controller to add flying capabilities?

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 KoJix · May 01, 2015 at 01:00 PM 0
Share

I got a Script that alows the player to move where the OVR is looking.

You've to add a rigidbody to the game object and you should be good to go. (ofcourse you need the OVR camera's as child object).

 using UnityEngine;
 using System.Collections;
 
 public class Spectator : $$anonymous$$onoBehaviour {
 
     public static float speed = 30.0f;
 
     public GameObject oculusLeftEye;
 
     Rigidbody rr;
 
     Vector3 axis;
 
     float rotationY;
     float rotationX;
     float rotationZ;
 
 
     void Start (){
         rr = GetComponent<Rigidbody> ();
     }
     
     void Update () {
 
 
         if(Input.Get$$anonymous$$ey($$anonymous$$eyCode.LeftShift) || Input.Get$$anonymous$$ey($$anonymous$$eyCode.RightShift) || Input.Get$$anonymous$$ey("joystick button 5")) {
             speed = 60.0f; 
         }
 
         else {
             speed = 30.0f; 
         }
 
         if (Input.Get$$anonymous$$ey ($$anonymous$$eyCode.W)) {
             rotationX = oculusLeftEye.transform.localRotation.x / 2;
             rotationY = oculusLeftEye.transform.localRotation.y / 2;
             rotationZ = oculusLeftEye.transform.localRotation.z;
             
             axis = new Vector3 (rotationX, rotationY, rotationZ);
             
             rr.velocity = oculusLeftEye.transform.forward * speed;
             
         } else if (Input.Get$$anonymous$$eyUp ($$anonymous$$eyCode.W)) {
             rr.velocity = oculusLeftEye.transform.forward * 0f;
         }
         
         if (Input.Get$$anonymous$$ey ($$anonymous$$eyCode.S)) {
             rotationX = oculusLeftEye.transform.localRotation.x / 2;
             rotationY = oculusLeftEye.transform.localRotation.y / 2;
             rotationZ = oculusLeftEye.transform.localRotation.z;
             
             axis = new Vector3 (rotationX, rotationY, rotationZ);
             
             rr.velocity = oculusLeftEye.transform.forward *-1 * speed;
             
         } else if (Input.Get$$anonymous$$eyUp ($$anonymous$$eyCode.S)) {
             rr.velocity = oculusLeftEye.transform.forward *-1 * 0f;
         }
 
         if (Input.Get$$anonymous$$ey ($$anonymous$$eyCode.D)) {
             rotationX = oculusLeftEye.transform.localRotation.x / 2;
             rotationY = oculusLeftEye.transform.localRotation.y / 2;
             rotationZ = oculusLeftEye.transform.localRotation.z;
             
             axis = new Vector3 (rotationX, rotationY, rotationZ);
             
             rr.velocity = oculusLeftEye.transform.right * speed;
             
         } else if (Input.Get$$anonymous$$eyUp ($$anonymous$$eyCode.D)) {
             rr.velocity = oculusLeftEye.transform.right * 0f;
         }
 
         if (Input.Get$$anonymous$$ey ($$anonymous$$eyCode.A)) {
             rotationX = oculusLeftEye.transform.localRotation.x / 2;
             rotationY = oculusLeftEye.transform.localRotation.y / 2;
             rotationZ = oculusLeftEye.transform.localRotation.z;
             
             axis = new Vector3 (rotationX, rotationY, rotationZ);
             
             rr.velocity = oculusLeftEye.transform.right *-1 * speed;
             
         } else if (Input.Get$$anonymous$$eyUp ($$anonymous$$eyCode.A)) {
             rr.velocity = oculusLeftEye.transform.forward *-1 * 0f;
         }
     
     }
 }
 
 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

VR app controls are inverted 0 Answers

Oculus: Is player looking at Object A ? 1 Answer

How can integrate Oculus camera script in unity project? 0 Answers

How to make camera position relative to a specific target. 1 Answer

Set skateboard (gameobject) to rotate with OVR camera 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