- Home /
Find scene boundaries and center camera vertically
Hi! I would like to run a script function on a specific UI button click, that shows a vertical view of my scene.
The problem is that my scene is dynamic, specifically the Objects in the scene get created by running a script that reads a txt file with object names,types and position/scale/rotation. That means that at any given time the user can load a new "enviroment" in the scene.
Now, the approach I was thinking of is to :
a)find (somehow) the furthest object coordinates in each direction (x,z)
b)center my camera in the middle and move it high enough on the y-axis so it shows every object in the scene.
Has anyone done this before? I mainly wonder how to effectively "grab" the boundaries of my scene (it only needs to happen once on click) and if there is a function that makes the camera fit the coordinates.
Thanks in advance!
Your answer
Follow this Question
Related Questions
FPS Camera Collision 3 Answers
camera to turn 1 Answer
Rotating a camera that has MouseLook.cs attached 0 Answers
What kind of Camera is this? 0 Answers
Google Cardboard Control with Look at Mouse with Tresholds. 1 Answer