x


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

Sergey 1 gravatar image

Sergey 1
6 9 6 9

(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

GODLIKE gravatar image

GODLIKE
529 15 14 28

(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

By RSS:

Answers

Answers and Comments

Topics:

x4582
x1433
x115
x96

asked: Oct 03, 2010 at 01:03 PM

Seen: 1470 times

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