Search Unity

How to disable head orientation sensor on Oculus?

Discussion in 'AR/VR (XR) Discussion' started by blindmen, Oct 22, 2015.

  1. blindmen

    blindmen

    Joined:
    Sep 10, 2015
    Posts:
    34
    Hi at one scene I want to disable head positional and orientation tracking to prevent user to look around.

    I've used InputTracking.Recenter(); in update method, but this fix only for horizontal orientation, vertical movement is not affected ...

    any ideas?

    Thanks
     
  2. SniperEvan

    SniperEvan

    Joined:
    Mar 3, 2013
    Posts:
    161
    It's highly recommended not to do this. When the player moves their head they expect things to move. There's a good example of what freezing the rotation does to your brain in the Google Cardboard VR lab. It's really weird and disorienting.

    Its much better to direct the users focus by creating activity in the scene or by boxing them in with physical objects.
     
  3. blindmen

    blindmen

    Joined:
    Sep 10, 2015
    Posts:
    34
    @SniperEvan
    Thanks, then let's say I want to keep just one object on the same spot regardless of the head movement.
    What should be the best approach to this?
     
  4. SniperEvan

    SniperEvan

    Joined:
    Mar 3, 2013
    Posts:
    161
    Hey again,
    There's a few different things you could do depending on the context.

    1. Parent the object to the camera. For example on the object add this:
    gameObject.transform.setParent(Camera.main.transform)

    This would be useful for something like a helmet heads up display that always moves with the players head. If the object is far from the camera it will phase through objects, and possibly push things if it has a collider.

    2. Parent a dummy object to the camera and then use physics "push" the other object toward it.
    This way the object wont ghost through things, but will still push things around.

    Are you using this for UI, a physical object, or something else?
     
    blindmen likes this.
  5. blindmen

    blindmen

    Joined:
    Sep 10, 2015
    Posts:
    34
    @SniperEvan

    many thanks 1st point works like a charm :)
     
    SniperEvan likes this.
  6. SniperEvan

    SniperEvan

    Joined:
    Mar 3, 2013
    Posts:
    161