- Home /
Question by
haukesand · Mar 12, 2015 at 02:58 PM ·
cameracamera-movementdetection
Detect if player looks at an object?
How can I set a boolean on objects that are looked at in the viewport active?
If the player looks with the camera on one of a few objects a variable should change and make the camera target to it. As well it should make a video texture play on that object. How can I detect which objects are focused or almost focused by the camera?
Comment
You can use a raycast if you want the player to look directly at the object. http://docs.unity3d.com/ScriptReference/Physics.Raycast.html
Answer by SuricatoTI · Mar 12, 2015 at 04:14 PM
If you make an collider with istrigger and get all the collisions? Or ou can set an invisible object in the middle of your caracter vision and use it like mouseclick to get the object... I don't know if you understood :\
Your answer
