Gvr-unity-sdk: How to use the GVR reticle

Created on 27 Oct 2017  路  4Comments  路  Source: googlevr/gvr-unity-sdk

I want to use the reticle that comes with GVR with my game objects like it expands on the floor canvas that comes in the demo, but I don't see any special script on those buttons, and even if I change my objects to be UI layer, the reticle still doesn't expand on them.

How can I make it expand on a cube for example?

image

I tried to follow the instructions on this video but I think it's too old because it had things that don't exist now (like "gaze input module").

Found using:
Google VR SDK version: v1.100.1
Unity version: 5.6.2f1
Phone manufacturer, model, and O/S version: Android
Viewer manufacturer & model: Irrelevant

documentation bug

Most helpful comment

Good question!

The reticle will expand if the object it is pointing at is considered "interactive". You can see the implementation in the function SetPointerTarget of GvrReticlePointer.

So what makes something considered interactive?

An object is considered interactive if it implements the IPointerClickHandler, IPointerDownHandler, or IPointerDragHandler event system handlers. Alternatively, you can add the Unity script EventTrigger (which implements these interfaces) to the object. This indicates that the object will respond to pointer input. This is part of Unity's API for responding to events from the Event System.

Thanks,

Dan

All 4 comments

Good question!

The reticle will expand if the object it is pointing at is considered "interactive". You can see the implementation in the function SetPointerTarget of GvrReticlePointer.

So what makes something considered interactive?

An object is considered interactive if it implements the IPointerClickHandler, IPointerDownHandler, or IPointerDragHandler event system handlers. Alternatively, you can add the Unity script EventTrigger (which implements these interfaces) to the object. This indicates that the object will respond to pointer input. This is part of Unity's API for responding to events from the Event System.

Thanks,

Dan

I added EventTrigger script and it works. Thanks.

Is there a way to make it activate from further away?
I want it to activate on objects that are 100 units away.

Yes, on GvrReticlePointer you can change the property maxReticleDistance (assuming you are using the 1.100 version of the SDK).

Thanks,

Dan

Was this page helpful?
0 / 5 - 0 ratings