boB 21a16e637f Revert "retire Steam VR"
This reverts commit f627f1e1c3e7c010a70ba1eacfb7b3aab85ffd43.
2021-11-11 16:51:51 -05:00

29 lines
723 B
C#

using UnityEngine;
using System.Collections;
namespace Valve.VR.InteractionSystem.Sample
{
public class trackCam : MonoBehaviour
{
public float speed;
public bool negative;
void Update()
{
Vector3 look = Camera.main.transform.position - transform.position;
if (negative)
{
look = -look;
}
if (speed == 0)
{
transform.rotation = Quaternion.LookRotation(look);
}
else
{
transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.LookRotation(look), speed * Time.deltaTime);
}
}
}
}