- Home /
[VR] VIVE controller press to load scene
Hey all, so I have a small issue. I have a sort of "death screen" and would like when the user presses the trigger on either VIVE controller it will load a scene, for now we will just call it "Intro". I have this script already but keep getting messages that the "controller"does not exist in the context. I am very very new to coding in terms of Virtual Reality and have no idea what the actual "key" name is for the trigger on the VIVE controller. If anyone could help me fix my script it would be much appreciated!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using Valve.VR;
public class DeathLoad : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (controller.GetPress(TriggerButton))
{
controller.TriggerHapticPulse(1000);
SceneManager.LoadScene("Intro");
}
}
}
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
Random problem with Oculus hands 0 Answers
An OS design issue: File types associated with their appropriate programs 1 Answer
Blocking level progression. 1 Answer