SmoothFollow At Locked Distance

Hey I’m trying to setup to have my camera follow a spaceship at a set distance ( in 3d space). So the camera would always be a certain distance behind but would ‘smooth follow’ the other axis. My problem is that right now the smooth follow starts to fall way behind the ship when it starts moving fast. Heres the SmoothFollow script I’m using http://www.unifycommunity.com/wiki/index.php?title=SmoothFollow2

I’ve been banging my head against my desk for days trying to figure this out any insight or pointers will be greatly appreciated.

Force the distance…

// at the end of the Update.
	transform.position=target.position;
	transform.Translate(-Vector3.forward * distance);

And this stuff should be put into the LateUpdate, not the Update. :wink:

thanks that worked but when i put it in LateUpdate the camera has a constant little shake to it until it stops moving

Hmmm… Migrate the camera script to the player controller. Reference the camera as Camera.main.transform