- Home /
Make camera Zoom in or Zoom Out to focus all target objects
Hey guys, i some interval, i want to check all need objects on screen, and make the camera fit exactly this objects, with some help i can get this works:
tempAllCubes = createRotateObj(); Bounds bounds = new Bounds(); MeshRenderer[] renderers = GetComponentsInChildren<MeshRenderer>();
foreach(GameObject tempCube in allGameObjs)
{
if(tempCube!=actualGameObj)
{
bounds.Encapsulate(tempCube.renderer.bounds);
}
}
So this i get the target bounds!
Now i want make the camera FoV get zoom in or zoom out to fit this bounds!
Comment
Your answer
Follow this Question
Related Questions
2D is zoomed in/out on different ios devices 0 Answers
how to know the relationship between zoom ratio and field of view 1 Answer
Implementing Camera bounds proportionally to its ortographic size 0 Answers
Zoom camera to correct FoV based on Rect size 1 Answer
Camera movement and zoom bounds 0 Answers