Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Animating materials on Anima2D sprite mesh does not create a material instance

Discussion in '2D' started by tobiascook, May 25, 2018.

  1. tobiascook


    Aug 29, 2017
    I'm trying to understand the behaviour I'm seeing using Anima2d sprite meshes.

    I have a an emissive material which I am applying to a sprite mesh. I have a script which controls the emission colour of the material on the gameobject it is attached to. If I attach said script to a normal sprite, mesh renderer or a skinned mesh renderer, as soon as I modify the emission colour on the script Unity automatically creates an instance of the attached material. This is desired behaviour for me. Attached to the sprite mesh, however, modifying the emission colour on the script instead modifies the original material directly. Since I want to use this one material on multiple instances of a particular object in the scene, this is not suitable behaviour. I'm sure I'm missing something obvious, but can anyone shed any light on this?