Before updating to Windows 10 you may need to return your Pro license. More information here

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.

more ▼

asked Oct 03, 2010 at 01:03 PM

avatar image

Sergey 1
6 9 6 10

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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 :)

more ▼

answered Oct 03, 2010 at 02:43 PM

avatar image

529 16 16 31

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Oct 03, 2010 at 01:03 PM

Seen: 1676 times

Last Updated: Oct 03, 2010 at 01:03 PM