Serious issue with Sprite Renderer and animations that update material properties on them

There is a quite serious issue that is easy to reproduce when animating material properties on sprite renderers in Unity 6.

If you have multiple sprites with an animation that modifies any properties on a material - which is quite a common thing to do - the sprite renderer glitches out and shows the incorrect sprite.

Moving the camera often highlights the problem, but I’ve had it with static cameras too.

Unity6SpriteIssue

I’ve created a small basic project on GitHub along with instructions on how to reproduce the issue:

The problem happens with both the Sprite-Lit-Default shader and with any custom ones based on it.

This is a very common thing to do in a Unity project, and this bug is consistent and easy to reproduce.

I’ve submitted a bug report and also found these forum posts which I believe are explaining the same issue:

Some interesting observations are:

  • Turning a game object in the hierarchy on/off at run can sometimes fix the issue.
  • Creating a script with an Update loop that updates a material property using either MaterialPropertyBlock or just SpriteRenderer.material.SetColor() does not display the same issue

It was confirmed and solved, here’s the bug tracker:

Awesome, thank you!

It does not seem like the bug has been solved (yet), but hopefully it does get fixed soon as its a blocker for us upgrading to Unity 6.

I think it’s been solved internally. The fix is awaiting review/approval.

Know if there are any updates on the bug? The fix is still labelled as “In Review” and has only been released in a 6000.1 alpha version.

This bug hasn’t been fixed yet, still happenning, manly when 2 or more of the same sprites are in the screen and one of them is on the edge.

1 Like

Here’s another one @Venkify

@MichelVictor There’s a bugs kinda like this in progress though this is possibly new

1 Like

We have fixed this issue, tested the fix and its currently in the process of landing in 6000.2
Will start backports once it lands.

@MichelVictor
Please feel free to submit a repro project, so we can confirm the same for the above.

Apologies for any inconvenience this may have caused.

1 Like

Does this mean that after it works in 6.2, you will implement it in the next LTS versions, or will it still take some time?
We are about to release a demo and need to know when it will be fixed, as it currently cannot be launched as it is.

If your issue is related to the issue I reported I might have some suggestions for you… My issue is here:

The first thing I’d try is packing your sprites into a sprite atlas, but it looks like they might already be?

You can also try using different materials on each SpriteRenderer. Make duplicates of your materials (maybe you can do this automatically on Awake()?).

I’d also suggest disabling dynamic draw call batching but I haven’t figured out how to do this. There’s a checkbox for it in the URP settings but it had no effect when I tried it.

Anyway, not sure if any of this will actually help, but I thought I’d share.

Please note that once the fix lands on 6000.2, we will backport to 6000.1 and 6000.0 within a week or 2 after testing the backports. Will keep this thread posted.