Search Unity

Camera/Controller Recentering when teleporting

Discussion in 'Daydream' started by glitchers, Dec 4, 2017.

  1. glitchers

    glitchers

    Joined:
    Apr 29, 2014
    Posts:
    64
    Hi,

    I am having some troubles getting the controller to always be relative to the head when teleporting and reorienting the player.

    I am rotating my player and calling InputTracking.Recenter. This works well for the camera but depending on what direction I was facing before/after the controller is not relative. I've tried to apply some offsets to keep the controller correctly oriented but it's very fiddly.

    Additionally I added an arrow which always points towards the forward set by InputTracking.Recenter and found sometimes it is 90° off and likewise when I recenter using the hardware button on the controller I am pointed back to that position not where the camera is facing.

    Does anyone have any experience with this?
     
  2. reedny

    reedny

    Joined:
    Mar 4, 2017
    Posts:
    57
    There is an optional GVR script (Assets/GoogleVR/Scripts/Controller/GvrRecenterOnlyController.cs) that can be attached to the Player game object (see attached image). It will only recenter the controller when the user uses the system button on the controller and leave the camera in its current orientation. Might help with your use case.
     

    Attached Files: