Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Help Wanted Using Oculus HMD and/or Oculus Touch for POV in Cinemachine

Discussion in 'Cinemachine' started by Dirrogate, Jun 28, 2020.

  1. Dirrogate


    Feb 18, 2014
    With the introduction of the new Input manager, and thankfully the update to support it in Cinemachine 2.6, all works well for using the mouse to "look around" with the POV option in cinemachine camera systems.

    Now, as in the attached pic below, I've got a working Oculus Quest based camera tracking "rig" which allows me to use UnityRecorder to record live, either an in-game cinematic camera move as a video or, record the actual values as a .anim file to later tweak (all this done via UnityRecoder)...

    This setup is already working properly when using an oculus OVR prefab and attaching a child camera as the recording camera.

    Oculus Cinematic Rig.jpg

    Help needed:
    What I'd like to do is:
    - Use this Oculus Headset rig via the new input manger (input manager has an XR input option)
    - if the Oculus HMD itself can't be tracked via the Input Manager, then perhaps the left/right controller itself being tracked in space.

    This would allow me to pan the view smoother than using the Mouse in POV in cinemachine.

    Could anyone help in the setup with an action map for the input manager that works with Cinemachine Input

    I'm not a coder, so can't script any logic to do so.
    @Gregoryl would you help with the above, please?

    Cinemachine, how about an "XR Camera Tracker" add-on script to the Cinemachine ecosystem that adds this functionality so that any Oculus/Vive HMD or Oculus Touch/ Vive Controller can be used as input to drive functions such as POV in Cinemachine?
    This would make Cinemachine a true cinematic camera system.
    Last edited: Jun 28, 2020
  2. Gregoryl


    Unity Technologies

    Dec 22, 2016
    It feels a little strange to be wanting to do this via input. It might be hard to get a 1:1 movement. I'm not sure, however, and as I don't have an XR headset in my home office, it might be difficult for me to be of much help.

    Why not instead use a normal XR rig, but disable the XR's Camera component and replace it with a passive vcam component (CinemachineVirtualCamera component with DoNoting in Aim and Body). Then that vcam will be 100% controlled by the XR headset, position and rotation. When that vcam is active the main camera (with the CM brain) will track it exactly.

    Alternatively, have a separate vcam with Transposer in Body and SameAsFollowTarget in Aim track the invisible GameObject controlled by the XR headset. Then, you can add damping if you want it.
  3. Dirrogate


    Feb 18, 2014
    That's an interesting perspective, @Gregoryl .
    I'm currently using a plain Unity camera as a child of the Oculus XR rig (Ovr Player prefab)
    I'll use instead, a Cinemachine Vcam.

    In wanting to include custom 'input controls' within Cinemachine, I was looking at an integrated approach that aids in making realtime "Virtual Production" more intuitive within the Cinemachine ecosystem (less hassle and steps involved than creating XR rigs, swapping cameras out etc)