gaze/look at object to load new scene

Hi guys! i’m pretty sure that there’s already an answer to this question, but i can’t find the appropriate tags to look for… Do you know how this works? I want to look at an image in virtual reality, load a little animation ad launch a script which launch another scene… can you point me in the right direction please? Thanks. Mimini

I would add a collider to the object, then use a “raycast” to determine if the camera is looking to the object.
e.g. (uncomplied, example only, probably has errors)

Ray r= new Ray(colliderobjet.position-camera.position, camera.forward);
RaycastHit hit;
bool contact=colliderobject.GetComponent<Collider>().Raycast(r,out hit,MaxDetectDistance);