- Home /
i want to know what object is the closer to the camera to see
I have a camera with position and a vector rotation, and a list of objects in the scene. how can i tell what object the camera is most looking at?
is there a way to compare position and lookAt? I am assuming i will have to loop the objects and compare a value any ideas?
thanks guys
Answer by Andres-Fernandez · Sep 10, 2014 at 06:18 AM
To check the distance you can use Raycast. You will need the RaycastHit to get the info on the distance.
The problem here is that the closest object may not be the object that takes up the most of the view of the camera. That would require some other calculation.
Your answer
Follow this Question
Related Questions
How to get object to face direction it's flying rather than looking at the target 2 Answers
Get mapping postion of 1 point on a plane defined by 3 points 1 Answer
Get a child object to rotate a parent to the cameras direction -1 Answers
What is the algorithm to assign to transform.right? 1 Answer
Control and restrict object movement 0 Answers