x


3rd person camera controls

Hi

Im pretty new to unity but picking it up quickly.

Im building a 3rd person game and am using the spring follow camera script contained in the unity 3rd person tutorial which works great but i want to be able to use the mouse to look up and down as well as the arrow keys to move.

Ive tried but failed so would be great if someone give me a shove in the right direction as to what i need to add to the script to achieve this.

cheers jules

more ▼

asked May 27 '11 at 09:29 PM

julesown gravatar image

julesown
16 12 12 14

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

3 answers: sort voted first

HI there... I have created an animated character in daz and exported it... works perfectly... only one problem the character moves 5 times faster than the camera, and the camera cant keep up... when i stop moving the character, the camera stops then the character slids back to camera range... any help here... thanx

more ▼

answered May 04 '12 at 07:35 PM

domtate123 gravatar image

domtate123
0 1 5 5

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

i have a query... i have created a character in daz and imported into unity, works perfectly.. only one problem.. the character moves 5 times faster than camera, now when i stop moving character, the camera stops and the character slids backward to main camera position... this is a 3rd person game ... any help would apprecdiated... i`m using UNITY 3.5.0f5 pro

more ▼

answered May 04 '12 at 07:35 PM

domtate123 gravatar image

domtate123
0 1 5 5

change the max speed in the inspector, close to "height" "distance" and so on.

Apr 30 at 01:37 PM midna
(comments are locked)
10|3000 characters needed characters left

There are several ways you can make a "third person camera" and I am sure if you ask ten people you will get ten answers on this question. Here is one approach that I have seen used:

  • A game object for the camera to reside on that is not the same game object as the character. It can be a child of the character or a separate game object all together; I have seen this both ways. Sounds like you have this already.
  • A character controller on the character for the arrow keys for navigation. This roughly controls the position of the camera in space (because the camera follows its target via the spring script you have).
  • A mouse look script on a separate game object with the camera that controls the orientation (but not the position) of the camera. This script will accept input from the mouse to alter the orientation of the camera. There is a mouse look script in Standard Assets and there are mouse look scripts and many other of these scripts on unifycommunity.com. I would browse through there first.

What you have described is a little odd because free range to look on a camera that is not first person is a little unusual. What you might consider is a third person where the mouse input actuates a limited 'spring style' look of limited degrees but always looks over the shoulder or past the forward of the character. I have also seen configurations where the camera was offset from the character, look forward with or over the shoulder of the character but mouse input resulted in an orbit behind the character. You will just have to determine what's the correct effect for your game and go with it. There is really no one correct way to do third person although someone on the wiki might have a ready made solution that you really like.

MouseLook plus

Mouse orbit

Smooth mouse look

more ▼

answered May 28 '11 at 12:46 AM

raypendergraph gravatar image

raypendergraph
1.6k 15 21 37

quoting Ray Penergraph: "What you have described is a little odd because free range to look on a camera that is not first person is a little unusual."

I am confused by that statement. I thought that was the standard for most 3rd person games. Limited degrees would seem like an unusual aberration.

Dec 28 '11 at 08:33 PM spacelion88
(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:

x1372
x499
x90
x20

asked: May 27 '11 at 09:29 PM

Seen: 6425 times

Last Updated: Apr 30 at 01:37 PM