Detect when VR user looks away from an object?

Hello,

I’m new to unity3d development!

I am building a VR education app for Quest 2 and basically want to detect when a user looks away from an object (count how many times they look away, and start a timer for how long they look away).

I want to store & collect these metrics for analysis (so store them in a database perhaps?) Is this even possible?

Essentially, I want to detect when a user is looking away from the content to see if they are being distracted by the environment etc!

could use Vector3.Dot (to check if look away)

Or this, if object goes totally outside of view

to save the data…could send using webrequests, if you have server to receive it:

it could be possible to use unity analytics to collect those events, but i don’t have experience/info on those…

there used to be heatmaps feature, to see where user visited etc. which sounds like good way to collect view direction data, but i dont know if its still available
https://docs.unity3d.com/Manual/UnityAnalyticsOverview.html *NOTE: legacy old docs

1 Like

Thank you so much for all the links!

I didn’t expect to get a response so fast, thanks for the help mgear!

np! also one more simple(st) way:

1 Like

Perfect, hopefully this won’t be too hard to implement for a newbie.

I have some experience with programming (software dev student), however the unity engine, C# and VR development are all new to me lol