- Home /
how to create a TPS camera view?
Hi guys, I just want to know how to put the camera on the back of your character. I do have a script that follows the character but only in one direction. I want the camera to rotate if the character changed direction. for example, if the character turn left, the camera on its back will also turn left. here is my code for the camera:
var fixedPositionObject : Transform; var heightOfObject = 2; function Update () { fixedPositionObject.position = Vector3(
transform.position.x,
heightOfObject,
transform.position.z
);
}
There's a third person script that comes with unity why don't you just use that? Otherwise have you added the camera as a child object of your player - then just place the camera behind your player and that should sort out the rotation problem you mentioned.
Take a look at Component menu: /Camera-Control/Smooth Follow.
Answer by Ziad · Mar 09, 2013 at 06:27 AM
3DBuzz.com provides a very useful tutorials about this here