I am new to Virtual Reality. I am using Oculus Rift for Headset and Leap Motion for interactivity. When the user will rotate an object with his hands, I want a specific event to get triggered.
Here's my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class step1 : MonoBehaviour
{
public GameObject object;
public ParticleSystem event;
void Start()
{
}
// Update is called once per frame
void Update()
{
if(object.transform.rotation == Quaternion.AngleAxis(-30,Vector3.right))
{
Debug.Log("Done");
event.Play();
}
}
}