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.
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
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.