0

I'm making a VR Application in unity using steam VR, VRTK and HTC Vive. I have a simple Reset Button and what I want is, When I click on that reset button my VR Camera should turn towards the target Game Object and starts looking at it here is my code I use Transform. LookAt but it is not working.

Please help to solve this issue.

Thanks

using UnityEngine;

using System.Collections;

public class reset : MonoBehaviour
{
public Transform target;

public void resetview()
{
    // Rotate the camera every frame so it keeps looking at the target
    transform.LookAt(target);
  }
}
Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59
Nouman Khan
  • 3
  • 1
  • 6

1 Answers1

0

VR device override everytime the camera rotation of your Player RIG. You need to disable your camera device and enable another camera outside of the VR player RIG and set how main camera. Modify this camera instead of the VR camera RIG.

joreldraw
  • 1,736
  • 1
  • 14
  • 28
  • u mean that i have to disable the steamVR camera rig – Nouman Khan Dec 27 '18 at 07:35
  • yes, if not the device override the rotation. Another way is to disable the device control but is more complex. Easy way is to set another camera for your reset customization and later come back to device camera. – joreldraw Dec 27 '18 at 08:58