How do I change the albedo_color of a single instance of a 3d scene?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Henry Liu

I have a 3d enemy scene with a material. In my world scene, I’ve instanced in a bunch of these enemies. I want them to flash red when they get hit. Currently, I have to duplicate() the material on each enemy in _ready() so that I can change its albedo_color separately from the other enemies. Is there a nicer solution to this problem without having to make individual copies of the material for each enemy?

:bust_in_silhouette: Reply From: Calinou

Is there a nicer solution to this problem without having to make individual copies of the material for each enemy?

Not yet, but this will be supported in Godot 4.0 thanks to per-instance shader uniforms.