Page 1 of 1

Camera Question

Posted: Sun Apr 17, 2011 4:46 pm
by chronicacid
why does

simplecharacterinput.cs use
Camera.Position = CharacterController.Body.BufferedStates.InterpolatedStates.Position + CameraOffset;

and charactercontrollerinput.cs

Camera.Position = CharacterController.Body.Position + CameraOffset;

Re: Camera Question

Posted: Sun Apr 17, 2011 6:09 pm
by Norbo
Using the interpolated position allows for smoother movement when using internal timesteps. With internal timestepping, the engine may go forward two steps in one frame and zero the next depending on how much game time passes. If the direct, non-interpolated position is used, the movement won't be as smooth as it could be.

There's no reason behind why the Simple character controller does that and the CharacterController does not; it's just an oversight.