I am currently in-progress on a stunt car racing game. I have positioned my main game camera where I want it behind the vehicle and applied the default SmoothFollow script to it. I created an empty game object near the rear of the vehicle and made this the transform that the camera targets for the SmoothFollow. When I make turns around corners the car appears to stutter (or it’s the camera’s movement stuttering?), but I’ve double checked the Wheel Collider settings, the physics settings, the framerate and have deduced this is something happening from the camera follow script. Any help as to why this might be happening would be awesome!
I would assume that any existing ‘follow cam’ scripts would already do this, but you might check and make sure the camera transform is updated in LateUpdate() rather than in Update() or FixedUpdate().
I looked into the script and checked this…changing it to “LateUpdate” didn’t seem to resolve the issue. Thank you for the response. I guess I’m going to have to dig a bit deeper into this issue. BTW I dunno if it helps, but this is what the script looks like.
"var target : Transform;
var distance = 3.0;
var height = 3.0;
var damping = 5.0;
var smoothRotation = true;
var rotationDamping = 10.0;
function LateUpdate () {
var wantedPosition = target.TransformPoint(0, height, -distance);
transform.position = Vector3.Lerp (transform.position, wantedPosition, Time.deltaTime * damping);
if (smoothRotation) {
var wantedRotation = Quaternion.LookRotation(target.position - transform.position, target.up);
transform.rotation = Quaternion.Slerp (transform.rotation, wantedRotation, Time.deltaTime * rotationDamping);
}
else transform.LookAt (target, target.up);
}"