Search Unity

3rd person player

Discussion in 'Getting Started' started by jampakdd, Jun 18, 2015.

  1. jampakdd

    jampakdd

    Joined:
    Jul 8, 2014
    Posts:
    3
    I need help with creating a third person player. What I'm aiming for is something much like GTA 5 and/or the Arma 3 third person cameras. I want the player to go "forward" relative to the cameras target(or direction its looking) but if I were to say hold alt, the player could freely look around. When the button was released the camera would snap back to its "default" behind the player... Honestly at this point I am begging anyone to help me I have been searching for a solution but know only really basic c#. It would be great if someone could pm me on skype and help me one on one with a bit quicker responses... Tell me if you can help and well figure out a way to speak... until then I will check my email frequently and get back to you as soon as possible. Thanks for your time!
     
  2. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    814
    My book Unity in Action covers camera control for both first- and third-person cameras. Admittedly there is no single explanation of both parts (ie. a third-person camera that can look around like a first-person camera) but that shouldn't be hard to mash together once you understand each separately.

    Making the player move forward relative to the camera is also covered along with 3rd person camera; it's a technique called "camera relative controls". The key is to use TransformDirection() to get "forward" from the camera's perspective transformed into global space.