How can I automatically reduce transparency of multiple objects using an empty's proximity?

So I have multiple objects (theyre instances actually) with the same material applied, im essentially animating a coin pickup, so i wanted a way to decrease transparency of the objects when my charcter comes close to them.

Is there a way to do this?
I know I can use the visibility options but thats too quick for my taste hence I wanted to do it via materials

If you want to animate separately the materials, you’ve got two solutions. Make unique user for each objects data so they can have a unique material. Or ifyou want to keep instanced meshes you can assign material by object instead object’s data.
(triangle icone by the end of material name).
image

then use a driver like this…


assumingyou change the the second object name for each coin (here it’s cube) to get the distance.

as you will “leave” the coin the distance ll increase, so you ll have to hide it before going to next coin…

hope it s clear …

1 Like

You could probably assign the driver to a value node instead, and use a greater than node to give it a threshold. You probably want the coin to disappear abruptly rather than gradually fade out.

the request was that @Charles_Weaver

This is a setup without drivers: the “Grid” object is the instance parent.

2 Likes

ok thank you all ill try these solutions!

can i use this driver to change the visibility option as well?