Does changing a material proprety at runtime create a new material?

I remember reading some time ago in some forum post that changing a material property at runtime prompts Unity to create a new material “under the hood”. Is this true?

For example, if I swap out the texture, the normal map, or change the tint color of a certain material at runtime, does Unity create new materials for each one of those changes?

Maybe it does ‘under the hood’ but it shouldn’t be something to worry about. I’d assume that even worst case you’re changing colour manually every frame then Unity would just discard and delete those unused materials

The API documentation for Renderer.material states as much and notes that you have to destroy them manually. You can change Renderer.sharedMaterial to modify the actual material, but this will understandably affect all objects using it.

does Unity create new materials for each one of those changes?

No. Once the object has its own material instance any further changes would use the instance material from now on. Keep in mind that having a lot of individual materials is bad for performance as they can not batch, even when all values are 100% exactly the same. You rarely need / want to directly modify materials (though there are exceptions). In most cases it makes more sense to replace the shared material of the renderer with another premade material.

Note: abandoned Material instances would keep to stick around and requires memory until you load a new level (which internally calls UnloadUnusedAssets) or by manually calling UnloadUnusedAssets. Keep in mind that this method is expensive as it has to re-evaluate the lifetime of all loaded UnityEngine.Object derived objects. So instantiated materials have to be actively destroyed to keep the scene clean.