x


Controlling camera rotation limits.

Hello, I'm new here :)

Currently working with a group of other students on a small adventure game as a school project, and none of us have any extensive Unity or game programming experience. It's a point-and-click game, so we have static cameras that follow our character via the SmoothLookAt script. The cameras never move in space, only rotate.

What we need is to find a small script that allows us to control how far a camera can rotate in any given direction, since we don't want the player to see the empty spaces at the edges of our scenes. :)

I'm pretty sure we can use Clamp to achieve this, but I'm not sure how to actually script it... Like I mentioned, we're all kind of new to this. :P Any help would be greatly appreciated.

Best regards, Simon.

more ▼

asked Feb 20 '10 at 03:43 PM

user-1320 gravatar image

user-1320
11 1 1 2

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

1 answer: sort voted first

The MouseLook script in standard assets does this.

more ▼

answered Feb 20 '10 at 04:21 PM

Eric5h5 gravatar image

Eric5h5
80k 41 131 518

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

x5049
x2980
x2155
x133
x79

asked: Feb 20 '10 at 03:43 PM

Seen: 3442 times

Last Updated: Feb 20 '10 at 03:43 PM