- Home /
Is there an elegant way of limiting camera's position?
I've got a small game, where the user uses Horizontal axis to move the camera along Z.
However, it's currently possible to have the camera looking in empty space, far from terrain. It's position doesn't have min Z and max Z. I could of course hardcode the min/max value, but I'm wondering if it could be done more nicely.
Thanks alot.
Answer by GODLIKE · Oct 03, 2010 at 02:43 PM
You can put two collision planes that act only on the camera or put the min/max Z values editable in the camera script, it's easy, just declare them as variable at the beginning of the script so you can edit them in each scene :)
Your answer
Follow this Question
Related Questions
Restrict Camera movement in its local space 0 Answers
Place object in front of me with given Translation Vector 0 Answers
Vuforia camera frustum out of view after image target is lost 0 Answers
I want to change gun position with my camera joystick 0 Answers
Smoothly zoom object at point or camera boundaries 2 Answers