• 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 ian1908 · Apr 17, 2016 at 12:05 PM · oculusinputmanagerremote

Oculus CV1 Remote Input mapping

I would like to map the main CV1 remote button to Fire1 in the Inputmanager, any suggestions?

Comment
Add comment · Show 2
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 7a · Apr 17, 2016 at 03:17 PM 0
Share

By main input do You mean one of XBOX controller's buttons or which one?

avatar image ian1908 · Apr 17, 2016 at 03:23 PM 1
Share

No, not the Xbox Controller. With the Oculus CV1 there is a remote included. This remote has a dpad with a select Button in the middle. I would like to use this select Button and other remote Buttons in the unity input manager but dont know how.

6 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by elmir_jagudin · Jan 31, 2017 at 12:38 PM

I have now found out that the trick to getting OVRInput.Get() work properly is to make sure that OVRInput.Update() is called regularly. This can either be done manually or it will be performed automatically if the OVRCameraRig is used, instead of a normal camera.

Here is the steps I took to make input work:

  • Download the Oculus Utilities for Unity 5 package here: https://developer3.oculus.com/downloads/game-engines/1.10.0/Oculus_Utilities_for_Unity_5/

  • Unzip and import the OculusUtilities.unitypackage file (Assets -> Import Package -> Custom Package ...)

  • Make sure 'Virtual Reality Supported' check box is on in Player Settings (Edit -> Project Settings -> Player)

  • Make sure that OVRInput.Update() is called regularly (for each frame?)

Now you can use for example OVRInput.Get(OVRInput.Button.One) calls to check if the middle round button on the oculus remote is pressed.

Here is an example class that tracks if some of the buttons are pressed during a frame:

 using UnityEngine;
 
 public class OculusRemote : MonoBehaviour {
     void Update ()
     {
         OVRInput.Update(); // need to be called for checks below to work
 
         if (OVRInput.Get(OVRInput.Button.DpadLeft)) {
             print("left button pressed");
         }
         if (OVRInput.Get(OVRInput.Button.DpadRight)) {
             print("right button pressed");
         }
         if (OVRInput.Get(OVRInput.Button.One)) {
             print("round button pressed");
         }
     }
 }

Just attach if to any game object in the scene, and you should see the printouts in the console.

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 arroyoruy · Mar 05, 2017 at 11:14 PM 0
Share

It is important to use OVRInput.Update() before doing the checks. But, you do not have to import the whole Utilities package in your project, In a clean new project I was able to read all Oculus Touch buttons by only importing the scripts in \Assets\OVR\Scripts and \Assets\OVR\Scripts\Util

avatar image
1

Answer by 7a · Apr 17, 2016 at 03:25 PM

Thanks for clarification, here comes official help https://developer.oculus.com/documentation/game-engines/latest/concepts/unity-ovrinput/#unity-ovrinput-rift-remote :)

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
1

Answer by Bapez · May 03, 2016 at 12:35 PM

Still trying to figure this out. It keeps giving me an error "NullReferenceException: Object reference not set to an instance of an object OVRInput.GetUp (Button virtualMask, Controller controllerMask) (at Assets/OVR/Scripts/OVRInput.cs:600) "

Can you help me how you did it? @ian1908 or @7a

Comment
Add comment · Show 9 · 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 7a · May 04, 2016 at 11:09 AM 0
Share

Could You please copy/past here several lines from Your version of /OVRInput.cs:600 I have an idea and that may help :)

avatar image Bapez · May 04, 2016 at 11:37 AM 1
Share

Thank you for your time!

What i now use is this line of code

 if (OVRInput.GetUp(OVRInput.Button.One, OVRInput.Controller.Remote))
         {
             Debug.Log("remote click");
         }

Is doesnt give any errors, but It doesn't work.

Here are the serveral lines:

 /// <summary>
     /// Gets the current up state of the given virtual button mask with the given controller mask.
     /// Returns true if any masked button was released this frame on any masked controller and no other masked button is still down this frame.
     /// </summary>
     public static bool GetUp(Button virtual$$anonymous$$ask, Controller controller$$anonymous$$ask = Controller.Active)
     {
         return GetResolvedButtonUp(virtual$$anonymous$$ask, RawButton.None, controller$$anonymous$$ask);
     }
 
     /// <summary>
     /// Gets the current up state of the given raw button mask with the given controller mask.
     /// Returns true if any masked button was released this frame on any masked controller and no other masked button is still down this frame.
     /// </summary>
     public static bool GetUp(RawButton raw$$anonymous$$ask, Controller controller$$anonymous$$ask = Controller.Active)
     {
         return GetResolvedButtonUp(Button.None, raw$$anonymous$$ask, controller$$anonymous$$ask);
     }
 
     private static bool GetResolvedButtonUp(Button virtual$$anonymous$$ask, RawButton raw$$anonymous$$ask, Controller controller$$anonymous$$ask)
     {
         bool up = false;
 
         if ((controller$$anonymous$$ask & Controller.Active) != 0)
             controller$$anonymous$$ask |= activeControllerType;
 
         for (int i = 0; i < controllers.Count; i++)
         {
             OVRControllerBase controller = controllers[i];
 
             if (ShouldResolveController(controller.controllerType, controller$$anonymous$$ask))
             {
                 RawButton resolved$$anonymous$$ask = raw$$anonymous$$ask | controller.ResolveToRaw$$anonymous$$ask(virtual$$anonymous$$ask);
 
                 if (((RawButton)controller.currentState.Buttons & resolved$$anonymous$$ask) != 0)
                 {
                     return false;
                 }
 
                 if ((((RawButton)controller.currentState.Buttons & resolved$$anonymous$$ask) == 0)
                     && (((RawButton)controller.previousState.Buttons & resolved$$anonymous$$ask) != 0))
                 {
                     up = true;
                 }
             }
         }
 
         return up;
     }
 
avatar image 7a Bapez · May 04, 2016 at 11:59 AM 0
Share

I haven't had my hands on CV1 yet only D$$anonymous$$2 so can't test and looks like RawButton.Start must work, from the sample OVRInput.GetUp(OVRInput.RawButton.Start);

avatar image Bapez 7a · May 04, 2016 at 12:10 PM 0
Share

Thankyou again!

Unfortunatly that doesn't work aswell :(.

I double checked if the remote is on. This is really weird.

I am also on unity version 5.3.4p3

Show more comments
Show more comments
avatar image 7a Bapez · May 04, 2016 at 01:12 PM 0
Share

Hooray! :)

avatar image Bapez 7a · May 04, 2016 at 01:16 PM 1
Share

Thankyou again for your time and help! :)

avatar image
0

Answer by 3janeiscool · Nov 24, 2016 at 09:54 PM

please @Bapez. explain further your findings in : "you must use the OVRcameracontroller from within the package".

I cant figure out where to start modifying my script like you have done:

 if (OVRInput.GetUp(OVRInput.Button.One, OVRInput.Controller.Remote))

is it possible to use the OVRinput by running your script from the OVRcameracontroller or do you have to inject your code into the OVRinput script?

BR / Fredrik (DEV. "Dactyl Nightmare")

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 Hanne_Huygelier · Jan 31, 2017 at 08:33 PM

Hi,

I am also having trouble making the oculus remote and touch controllers work in Unity version 5.4.3f1p. Although I haven't figured out how to make the controllers respond to everything, I did discover that "Submit" and "Joystick button 0" respond to "Button.One" on the Oculus Remote. But based on the documentation and the Input Editor it's unclear why that is the case.

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
  • 1
  • 2
  • ›

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

62 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

Related Questions

using Oculus Remote with new input system 0 Answers

oculus quest2 crash at com.unity.oculus.OculusUnity exception,unity crash in oculus quest 2 0 Answers

Oculus Integration & Smooth object rotation by grab 0 Answers

Unity Remote 4 stopped working 2 Answers

What has happened to unity remote 5 in android app store? 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