I have a 2.5D side-view game in which you enter a building and only the room you are in is visible, and every other room is covered with simple CSGBox mesh with black material like this:
Logic is simple, every room has it's own area with:
blackFade.visible = false
blackFade.visible = true
So if I go from Room 4 to Room 1, the logic in Room 4 will turn visible to true for itself, and Room 1 logic will turn visible false for itself.
And it works but it's not clean since it just pops in and out. I wanted to play FadeIn and FadeOut animation through AnimationPlayer but the problem is: Every CSGBox uses the same material so if I change alpha for one, it changes for all of it. The easy solution is to make unique material for each black panel, but that's a lot of unique materials, what if there are 100 rooms, that's 100 unique materials that will change only alpa and the rest stays the same. So is there a way to modify a property (albedo -> alpha) for the material without making it unique and have hundreds of duplicates?