How to use a ball as a key to change material instance

Ive been messing around in the Engine, and I still cant find a solution, does anyone have an idea?