Using the parameter getters an setters and also the attach de attach

Ok but where is this code?

Basically, it doesn’t seem very OOP oriented.

Create a class, give it a custom dynamic material instance variable.
Update that variable when you create the instance.
Apply that variable to that specific instance.

If you are doing it off a Manager system (which is probably way better performance wise).

Then the process needs to be the same, but you access the objects from the manager instead.

Last question.
Are you just trying to toggle a bool inside a specidic material?

The setup is nearly identical anyway.
Changing at runtime kinda requires either material parameter collections, or dynamic material instances…