I am new and currently trying to get my Vive Controllers to Pause / Play Unity. So far i Can see my "hands" and it does Recognise my triggers, which is all it needs to.
Does Anyone know how to make it Pause when I press the Trigger and then Start when I press it again ?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
public class Viveinput : MonoBehaviour
{
[SteamVR_DefaultAction("Squeeze")]
public SteamVR_Action_Single squeezeAction;
public bool paused;
void Update () {
if (SteamVR_Input._default.inActions.GrabPinch.GetLastStateUp(SteamVR_Input_Sources.Any))
{
print(" Grab Pinch Up");
}
float triggerValue = squeezeAction.GetAxis(SteamVR_Input_Sources.Any);
if (triggerValue > 00f)
{
print(triggerValue);
}
}
}
This is What I am using atm for connection between controller and Unity.