Question by
Reaksmey-Rt · Nov 01, 2016 at 04:59 AM ·
unity 5vrtimeframeontriggerstay
device.GetTouchDown(SteamVR_Controller.ButtonMask.Trigger) In OnTriggerStay()
Hello !
Currently I use Unity 5.4.1f1-GVR7 To create a small game with VR HTC Vive Controller . But I have a problem with "device.GetTouchDown(SteamVR_Controller.ButtonMask.Trigger)" use in OnTriggerStay() That it is not Run Only one frame; This is my code:
private void OnTriggerStay(Collider other)
{
if (other.tag == "Oar")
{
if (device.GetTouchDown(SteamVR_Controller.ButtonMask.Trigger))
{
isCaughtOar = !isCaughtOar;
print(isCaughtOar);
}
}
}
Out put:
True
False
But I need only One Frame, So What's wrong with this and How can I do?
Thank you Advance !
Comment
Answer by rapinnz · Dec 11, 2018 at 10:06 PM
here is what i have done in another project that hopefully answers your question
untitled10.png
(21.0 kB)