Set A Material Instance To More Than One Object?

Hi, I’m working on a project where you can walk around and pick out color for walls. I have a linetrace highlighting a group of objects based on their physical material (all the walls for example), and when the player clicks on a highlighted group, a color selection widget comes up. In the widget, I can select a color for the wall.

This is fine if I want to set the color for individual walls, however I would like to set the material instance for all the walls that share the original material.

Here’s how I have my set color function set up:



Ive tried several ways to set the instanced material to all my walls at once but I cant quite figure it out. I have tied using several things including getting components by tags.

Is it possible to set a material to all objects that share a physical material??

I would like to avoid taking the material parameter collections route because that would mean I would have to set up a material parameter collection for every changeable material, and that seems redundant because I already have adjustable scalar parameters in the materials.