Oh, you trying to access a variable inside material? I don’t think you can do that.
What you can do - is change materials from BP using Material Instance.
I don’t know how is your project built, so I can’t give you the perfect solution. To figure that out is on you. All I can do, is point in a direction.