More efficient way to match transform than update?

I am creating a cool sense of size using smaller objects and render layers. Long story short, I apply this script to the background cam that is close to the stars model, and apply the player’s camera.

var playercam: GameObject;

function Update () {
transform.rotation = playercam.transform.rotation;
}

The problem is, Update creates a bit of lag when you move the camera. The background camera is a few frames off and is very ugly to look at. Is there any other way I could use to fix this? Thanks.

Picture of the result below.

Have you tried FixedUpdate() ?

I would not use FixedUpdate, since you are not dealing with physics but things that are rendering.You should try using LateUpdate to make sure you update after any camera movement has been done. If this does not do it, look into script execution order to make sure you update after the camera has moved.

2 Likes

Yeah, it’s LateUpdate you want.

Your objects Update function might be firing before the camera’s rotation is updated, so its taking last frames rotation. Giving that look that it’s off by a frame.

LateUpdate fires after all Update calls have fired.

1 Like

That is correct, sorry my bad

Thanks guys! I’ll give it a shot.