playMaker

Author Topic: 3rd person following camera with axis rotation  (Read 2093 times)

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
3rd person following camera with axis rotation
« on: April 05, 2014, 01:08:29 PM »
Not really a playmaker specific question although I am using playmaker actions to achieve it so thought I would ask.

So I have a character controller, a 3rd person camera.

Now the camera ALWAYS follows the character from behind, so if you were to move left the camera container would rotate the same direction as the character meaning the camera itself is still just looking at the character from behind.

The cameras hierarchy is basically CameraTracker which every frame matches the targets rotation and position, then the actual Camera is a child of that and is just set at a static position. So the CameraTracker can be used to orbit the character if required, although it doesn't at the moment).

So then the character has an action where it gets the axis vector (tried with relative camera and without) and then does smooth look at direction and chooses the given axis vector result (XZ plane), then uses the Simple Move on the character controller to move in the given direction.

However it doesn't turn properly it will run forward but if I press backwards it looks behind but then if I were to press left it would take me right, and it just acts all wonky... I am not sure if I should just move forward opposed to the directions and just rotate based off the axis change or something, I am not sure...

I am fairly new to all this stuff so a point in the right direction would be appreciated...
« Last Edit: April 05, 2014, 01:10:47 PM by Grofit »

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: 3rd person following camera with axis rotation
« Reply #1 on: April 05, 2014, 02:16:50 PM »
I have got it working how I wanted, I ended up just getting the axis separately and then doing a rotation based off horizontal axis and multiplying the vertical axis by the forward transform and default movement speed... it seems a bit verbose but cannot find a better way to do it currently.