I'm looking to have a game object rotate when the trigger on the oculus go is pressed but only then, I have the following code. Unfortunately this continuously roates even when I take my finger off the trigger,
public GameObject dummyrotate;
private bool rotate = false;
float rotationAmount = .3f;
float delaySpeed = .1f;
public void rotateAntiClockwise()
{
StartCoroutine(SlowSpin2());
}
public IEnumerator SlowSpin2()
{
float count = 0;
while (count <= 90)
{
dummyrotate.transform.Rotate(new Vector3(0,-rotationAmount,0));
count += rotationAmount;
yield return new WaitForSeconds(delaySpeed);
}
}
many thanks Jono