I have a number of objects that are going to be instantiated at runtime.
All of them share a single material, a substance, and they have a script that should allow them to react to a mouse click by changing a parameter and getting the clicked object to glow.
What I do is, inside my update, after I perform my tests, I execute the following code:
Renderer rend = GetComponent();
ProceduralMaterial mat = (ProceduralMaterial)rend.material;
mat.SetProceduralFloat(“Glow”, 1f);
mat.RebuildTexturesImmediately();
BUT
When I do this, ALL of the instantiated objects begin to glow!
on the image below, only the A object has the script. sitll, both of them toggle when I click.
Please notice that simply creating a copy of the substance in design time is not an option, since I’m going to have an arbitrary number of objects spawn on each scene.
What am I doing wong?
