What's the Best Way to Animate Material Properties in Unity 6?

Hi Graphics Team! Our team is working on a 2D game, using the 2D Renderer. We are looking into upgrading to Unity 6, but we’re facing issues regarding animation of material properties.

At the moment (2022.3), to animate material properties (e.g. During its charge-attack, the character briefly shines), we animate Material Property Blocks.

From my understanding, the new SRP batcher works in a different way and Material Property Blocks are no longer the way to go. How do you recommend we animate our material properties in Unity 6? We considered writing custom scripts to interface “AnimationClip → Material property”, but this gives no feedback to the animator during the creation of the animation.

NB: Using MaterialPropertyBlocks currently breaks 2D rendering in Unity 6 (issue). I don’t know if this is a bug or an unsupported feature, but an alternative would be very important for us to migrate to Unity 6.

Thanks for the bug report.

Material Property Blocks are no longer the way to go
Material Property Block is still used to set values for custom properties. But please note use of MaterialPropertyBlock will disable SRP-Batcher and 2D Renderers with custom Material Property Block will revert to Dynamic-Batching. However there shouldn’t be any difference in rendering though.

Using MaterialPropertyBlocks currently breaks 2D rendering
This is a bug for the above case. Will fix this asap and post an update here.

Was this ever resolved? What is the correct solution now?

Please take a look at: Renderer Shader User Value: Customize your visual per renderer

This is now supported for 2D Renderers in recent versions. Let us know if this helps or if you need more info.

Thank you, this information helps a lot!