I need some help with raycasting UI with Daydream. As there are only a demo for gameObjects (cubes), I want to know I can handle UI elements. The UI elements should react as usual, I mean highlighted and so on. The posts in How to use Graphic Raycaster with WorldSpace UI? were helpful, but completely.
I used DrawRay to see where my pointer is actually going through and it works good. But no log message is created.
void Update()
{
Quaternion ori = GvrController.Orientation;
Vector3 vector = ori * Vector3.forward;
Debug.DrawRay(transform.position, vector * 100000, Color.green);
PointerEventData pointerData = new PointerEventData(null);
pointerData.position = vector;
Debug.Log(vector);
List<RaycastResult> results = new List<RaycastResult>();
EventSystem.current.RaycastAll(pointerData, results);
if (results.Count > 0)
{
Debug.Log(results[0]);
}
}
Canvas (World Space) and Button is created as useal and not modified.