Question by
ZeroPunchProductions · Aug 18, 2020 at 07:07 AM ·
c#rotationvrparticle systemsteam
Help with pour effect script not registering in SteamVR?
Okay so I have this script attached to a particle system and that particle system is the child of a cup. I'm trying to make it so that when I rotate the cup past 90 degrees it activates a particle system. I got it to rotate in the way that I'm looking for however for some reason it doesn't seem to work in VR. When I attempt to grab the cup with my hands in VR it doesn't register the rotation of the cup at all. Also grabbing it in VR and then attempting to rotate the cup in the inspector doesn't work either. The moment I touch it in VR the rotation ceases to be registered at all. Can someone help with this and offer a possible solution?
Here's my script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DrinkPour : MonoBehaviour
{
[SerializeField]
private ParticleSystem FluidPour;
// Start is called before the first frame update
void Start()
{
FluidPour = GetComponent<ParticleSystem>();
}
// Update is called once per frame
void Update()
{
if (Vector3.Angle(Vector3.down, transform.forward) <= 90.0)
{
FluidPour.Play();
}
else
{
FluidPour.Stop();
}
}
}
Comment