I have this weird camera follow problem, where as, my camera target slowly creep forwards till my spaceship is flying behind it. i don’t know why- I’ve been itching my head all day. there is no silly rigidbody placements or alike I’ll quadrupedly checked every property on my scripts, yet it still occurs. Here the proof :
here’s my follow camera script:
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);
}
by the way, it’ll also be nice kill two bird with one stone and to have an answers why the SSAO seems to draw lines on my ship aswell. Thanks for any replies!