Jerky Camera

Hi guys, so I’ve got a question for all y’all, I’m working on a dungeon crawler type of game, and I’ve made an extremely simple camera for it, which esentially just constantly updates to be 4 units above on the Y axis, and 2 units down on the Z axis and then using the lookat function to set the angle and rotation. However, whenever I move the character in a direction in which he is not already facing, the camera jerks and becomes offset in a direction dependant on which direction the character is facing, but I have no idea why this is happening.

If it’s not something to do with the camera, I can only assume it’s something to do with the character controller, but I’ve looked for hours and can’t find anything that sticks out.

I’ve put a link to the project at the bottom of the question, it’s only around 50mb, the camera is called CCAM in the C# folder, and the controller is LacunaCharacterController, in the Java folder, the controller was based on the lerpz tutorial 3rd Person controller.

http://www.megaupload.com/?d=ERFR7I16

Take a look at the SmoothFollow script, that comes with Unity. You can attach this script to your camera and adjust the height and rotation damping properties to get the desired effect that you want.

If that doesn’t solve your needs I’d suggest looking at that script anyway to see how they have managed to get around any ‘jerkiness’.

It’s not a problem with your camera, but with your character, which is not centered on its own pivot point (which is where the character controller moves from, regardless of where the collider is).