Framing transposer cause weird shake when parallax

Hello,

I’m using Cinemachine framing transposer and I have a parallax script, but when I use both there is a weird sprites shake. If I use a custom script to follow the player it’s ok.

I use cinemachine and custom script to show the difference in the following video

3vt0im

Main camera setup:

Cinemachine virtual camera:

The parallax:

        private void LateUpdate()
        {
            var position = startPos;
            if (Honrizontal)
                position.x += HorizontalMultiplier * (cameraTransform.position.x - startCameraPos.x);

            if (Vertical)
                position.y += VerticalMultiplier * (cameraTransform.position.y - startCameraPos.y);


            transform.position = Vector3.Lerp(transform.position, position, smoothFactor.Value * Time.deltaTime);
        }

I’m guessing that the Parallax LateUpdate is being called before CinemachineBrain has set the camera position, so your calculations are based on stale data from the previous frame. The camera transform is updated in CinemachineBrain.LateUpdate(), which by default has a late execution order. Try setting the execution order of your Parallax script to be after CinemachineBrain.

1 Like

Thank you! I Tried different cinemachine update method, but not thinking about script order.

So I did this and now it work perfectly

7502465--924413--upload_2021-9-17_13-52-25.png

1 Like