I'm creating mobile vr game for google daydream and I want to add WorldSpace UI to my game and interact wit it. There is controller(works like Wii conroller) that tracks rotation, so I have rotating pivot in my game. There is example of how this controller works. I thought that good way of doing this is using raycast to interact with UI(it would be shot form pivot), but after searching I haven't found anything helpful. Maybe there is another simpler way to do it?
Add Gaze Input Module to EventSystem
object:
Add Graphic Raycaster component to Canvas(all canvases) and Assign MainCamera (child of Head) as Event Camera in the canvas component :
Add GvrReticle prefab as child of Main Camera. It should look like this:
Now your UI will respond to clicks (Input.GetMouseButtonDown(0)
) as usual. UI under Retical/Gaze will be clicked. All you have to do is map controller's input to click button in Input Manager
Hope this will help :)