Cinemachine + Parallax (2D): Either the background or the car is twitching - how to achieve stability?

Hello, colleagues!

I have a problem with the combination of Cinemachine and parallax effect in 2D. I hope for your experience and advice.

I have a car moving along the road (2D).

The camera follows it via Cinemachine Virtual Camera.
The background with the parallax effect is implemented manually, via a script based on Update() and transform.localPosition.

Behavior:
If the camera has Update Method = LateUpdate, and Blend Update Method = LateUpdate, then the background is smooth, as it should be, BUT the car starts to twitch.

If you switch these methods to FixedUpdate or SmartUpdate, then the car moves steadily, BUT the background starts to twitch.

I tried Lerp, different types of tracking, WaitForEndOfFrame - it doesn’t help.

Question:
What is the best way to sync parallax with Cinemachine?

Is it possible to have both the background and the car look smooth at the same time?

Since parallax is calculated based on camera position, you have to run that code after Cinemachine has positioned the camera. There are two ways to do this:

  1. Install a handler for CInemachineCore.CameraUpdatedEvent and do the work there, or
  2. Do it in a script’s LateUpdate, and set the script’s execution order to be after CinemachineBrain

Hello again,
Thanks for the suggestions earlier!

I’ve followed the advice and added the parallax update to the CinemachineCore.CameraUpdatedEvent using AddListener as recommended. Here’s the updated part of my code:

private void OnEnable()
{
    CinemachineCore.CameraUpdatedEvent.AddListener(OnCameraUpdated);
}

private void OnDisable()
{
    CinemachineCore.CameraUpdatedEvent.RemoveListener(OnCameraUpdated);
}

private void OnCameraUpdated(CinemachineBrain brain)
{
    if (brain.OutputCamera != Camera.main) return;
    UpdateParallax();
}

Unfortunately, I still see jittering on static background elements when the camera follows the moving car.

To clarify:

  • The car uses physics (WheelJoint2D + Rigidbody2D), and interpolation is set to Interpolate.
  • The Cinemachine Brain’s Update Method and Blend Update Method are both set to LateUpdate.
  • Parallax layers are updated only when the camera is within sector bounds.
  • Parallax logic is called after the camera moves (via CameraUpdatedEvent).
  • All static elements are non-physics objects and are not parented to moving objects.

Important note:
In the Editor, everything looks smooth — no jitter at all.
However, when I run the build on an actual mobile device (Android), the jitter becomes clearly visible. Static background elements seem to “vibrate” or “shimmer.”

Any idea what could cause this platform-specific issue? Could this be related to mobile rendering, refresh rate mismatch, subpixel precision, or something else entirely?

Really appreciate any further suggestions — thank you!

I see you tagged it as 2022-3 but I want to double-check; may I ask what version of Unity you’re using here?

There was an issue where interpolation wasn’t giving good results when rendering was restricted to much lower frame-rates. Because this is only happening on Android, I’m wondering if it’s fixed at 30 FPS and it relates to that. In theory you might be able to simulate that by setting the target frame-rate.

Of course, it might not be related at all as this couldn’t be reproduced on 2022-3.

If you turn-off the camera follow on Android and it’s smooth then the Transforms (and interpolation) is working fine so it’ll be related to something about the camera following mechanism.

Finally, you mentioned the (singular) Rigidbody2D is using interpolation however I’d expect there to be multiple Rigidbody2D being used here as opposed to only one as it’s a car. Can you check which body you’re following and that it is in deed using interpolation and that you’re not modifying the Transform here which can cause all sorts of problems with physics (I presume not because you’re seeing smooth movement outside of Android).

Also: can you say whether you’re using PixelPerfect? If you are, try disabling it. Does the jitter go away?

I don’t use PixelPerfect




I’ll try to set the frame rate higher..

So if you disable the camera following, is the car movement smooth on the device?

Added this code to the scene startup, the result became more than excellent. Works as it should.

    var rates = Screen.GetDisplayRefreshRates();

    if (rates.Length > 0)
    {
        int maxHz = 0;
        foreach (var rate in rates)
        {
            if (rate.refreshRate > maxHz)
                maxHz = rate.refreshRate;
        }

        Debug.Log("Max supported refresh rate: " + maxHz + " Hz");

        QualitySettings.vSyncCount = 0; 
        Application.targetFrameRate = maxHz; 
    }
    else
    {
        Debug.Log("GetDisplayRefreshRates returned nothing. Using default 60 FPS.");
        Application.targetFrameRate = 60;
    }

I presume then that this was simply that the device was rendering at 30Hz?

Either way, glad you got it sorted!

Good luck!

Hi GadOleg, I am facing exactly the same problem and I can not fix it. Did you already solve this problem?

Yes. I solved this problem. The problem was solved by increasing the number of frames on the phone. But I tried to change the settings in the cinema machine and this did not give an effect in my case