- Home /
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.
Answer by sneftel · Aug 11, 2011 at 03:12 PM
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).
I thought that could be it, but I think the model had its pivot point centered, how can I check/change it?
Take a look at the Z-position of your root bone in your animations. For an in-place run, that should be nearly zero.
Pardon my inexperience, but how and where would I find that? And if it's wrong, which I assume it is, do I change that in unity or in 3DS $$anonymous$$ax?
3DS $$anonymous$$ax. This is an art assets issue, not a game issue.
After having been over this extensively with the 3D animator, it doesn't seem to be the root bone it doesn't seem, when I place the collider for instance, it's not only behind the character, but also below him, any other possible solutions?
Answer by Meltdown · Aug 11, 2011 at 04:36 AM
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'.
I tried that, but it doesn't help, all the cameras have the same problem, they get offset by a few units in the opposite direction to which the player is facing, can't work it out at all.