Hi, as it says I’m not sure how I should change the tint of a GameObject without changing it for all other GameObjects using the same material. The easiest way of changing a tinting color of an object is by changing the material’s color, but the problem is this changes it for all GameObjects that are using the material.
Multiple duplicate materials is one solution, but for a large or variable number of GameObjects I don’t see this working. Any ideas?
The issue is the material is being used by multiple objects, so changing the color mask is going to effect all objects using that material (unless a copy is made).
You can use a script to modify the material on each Renderer at runtime, either by setting the value directly on the Renderer.material (which auto instantiates a new material) or using a MateriaPropertyBlock (which does not create a new material, and can be used with instancing), or by using vertex colors via AdditionalVertexStreams and a shader that uses that vertex color (which works well with batching).
Thanks, this’ll work, didn’t think it would be that simple because some things with Unity are confusing whether properties are readonly, or just creating copies when referencing them in code, or if you are actually accessing the property.