i want to adjust the distance of my camera from the game object that the whole game object can be seen on camera view. no more things. only the game object.
1 Answer
1Check if the angle (camera.forward, [camera,GameObject]) is > or < to half the field of view. To be thourough, you might need to do that for the eight points of the bounding box.
Thanks for answer Berenger. But I don't understand this answer. Can you give more details?
– EbiPenManThanks again.I dont have problem with first solution. My Object is box with BoxCollider and camera always in center of box. I want just set distance of camera for view box. But I cant fount currect box radius for second solution.
– EbiPenMan