I'm trying to detect cardboard button click with Cardboard Unity SDK.
I'm using this
Google VR SDK for Unity v1.40 (April 2017), right now it's the latest
I'm using Unity 5.6.0f3
, this also seems to be latest currently.
I'm not able to detect the button click using
GvrViewer.Instance.Triggered
Unity UI events are working as expected (Buttons and all), however I need to perform some action without using UI, like jumping on click of the button in the cardboard.
In the latest release Google VR SDK says that it has removed support for the magnetic button. However I'm not using the magnetic button. Mine has button which works with touch screen. (Version released after Google IO 2015)
This is the cardboard that I'm using
I just can't figure out how to detect the normal button press.
Any information is appreciated.
*Edit *
Following is the line from GvrViewer where Triggered
is populated.
private void DispatchEvents() {
// Update flags first by copying from device and other inputs.
Triggered = Input.GetMouseButtonDown(0);
#if UNITY_HAS_GOOGLEVR && (UNITY_ANDROID || UNITY_EDITOR)
Triggered |= GvrController.ClickButtonDown;
#endif // UNITY_HAS_GOOGLEVR && (UNITY_ANDROID || UNITY_EDITOR)
I have checked it in various combinations on the phone it doesn't work.
Unity
it should be a left mouse button click. – Hristomagnetometer
of phone. It was used in the first version of the cardboard, in the second version it uses screen touch. You are right that screen touch should be left click, that's how the value ofTriggered
variable is populated for the affected frame. It's not working though, I have added relevant code and link. – 11thdimension