Project VR Ray and collision


I have started a VR project and I need to implement the movement and interaction with Cardboard style glasses. I would need to know how to add the collision with objects and the movement or action with them after looking at them for X time. I’m a bit new to this playCanvas thing. If someone could help me, I appreciate it. Thank you very much for your attention.

I attach my basic project to move from one object to another. Proyecto Principal - PLAYCANVAS

The starter kit has an example of this where you look at the boxes and click on the screen and it changes the material colour

What you would have to do to adopt this is to do the same raycast every frame and when it has intersect with an object of interest, start recording how long the user is looking at it for and if it is more than X seconds, then move the camera parent to be Y units in front of the object that the user is looking at.

If the user looks away/not looking at any objects of interest then reset the timer.

1 Like