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
Comment
Answer by Glurth · Feb 26, 2016 at 05:37 PM
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);
Your answer
Follow this Question
Related Questions
Game crashing on Linux in VMware 1 Answer
Want to change level with steam VR controller 0 Answers
Timeline, cinemachine, post processing 0 Answers