3rd Person Movement / Camera Control Help or Advice Needed
Hey,
I'm relatively new to Unity and the forums (so I apologize if this question is a rookie one). I have a problem that I've been stuck on for days. I've looked through many YouTube videos, Unity forum posts etc and I just can't find what I'm looking for. I'll try my best to explain it...
Me and a friend are creating a modified replica of the indie steam game "What the Box?" for a school project. For those of you that haven't heard of this game, here's the link which shows the type of 3rd person movement that I'm trying to replicate.
What the Box?:
https://www.youtube.com/watch?v=LWiVoVdL9ig
So at the moment, the camera is positioned behind the player box. The box rotates horizontally using a mouse follow script and the WASD keys move the box forwards or backwards depending on where the character is facing. The box can also strafe sideways. So the problem that I'm having is, I have no vertical movement associated with mouse movement. I don't require a full vertical orbit of the box, just a slight orbit to provide enough of a view over the top of the box so that the player can shoot uphill.
Any tutorials, guides etc mostly use the Unity Standard Assets third person controller which is not what I'm looking for (all of the guides that use Ethan are focused on humanoid movement for replica shooters like Counter-Strike). I haven't found anything regarding the type of movement that I need and I'm really stuck at this point.
Here is an image & GIF of the stage I'm at and the problem that I am facing:
Image: https://i.imgur.com/8e0yNPE.png
GIF: https://i.imgur.com/7z6CS5E.gifv
(Note how the camera has no vertical mouse movement (which I also need) - only horizontal).
The scripts that I am using are as follows:
Attached to Camera:
Camera Inspector:
https://i.imgur.com/nbSZJR4.png
https://i.imgur.com/09VIlF4.png
Attached to Player:
Player Inspector:
https://i.imgur.com/vWEGZYi.png
https://i.imgur.com/09VIlF4.png
In the past I managed to get the vertical movement working but it would tilt the actual box (player) in the game to look upwards or downwards and break the horizontal mouse movement completely; I wanted to freeze the box but just have the camera orbit up and down but I couldn't figure out how.
Any help or advice would be greatly appreciated! I'm still learning so I'm sorry if me or my friend made some rookie mistakes.
Answer by MoDow · Dec 01, 2017 at 02:11 PM
Sorry for the poor formatting; I thought "& nbsp" would create spaces between lines (like it shows on my post preview) but I can't figure out how to do them on this forum!