cancel
Showing results for 
Search instead for 
Did you mean: 

OVR Camera rig won't reset

AnmaaVR
Explorer

I have a cube as a reset position located in x:0 y:0 z:0.

I am trying to player to move to the reset position after collision enter. The collision works but the player is not moving to the reset position.
I am using OVR Camera rig. Any idea how I can solve this?

  [SerializeField] Transform resetTransform;
  [SerializeField] GameObject player;
  [SerializeField] Camera playerHead;    

public void ResetPosition()
    {
        var rotationAngleY = playerHead.transform.rotation.eulerAngles.y - resetTransform.transform.rotation.y;
        player.transform.Rotate(0, -rotationAngleY, 0);
        var distanceDiff = resetTransform.position - playerHead.transform.position;
        player.transform.position += distanceDiff;
    }


 

0 REPLIES 0