Gradually changing from one material to another

Hi everyone!

I’m working on a blueprint at the moment which has a skeletal mesh in it, with a normal material applied to it. I want to change that material as the camera approaches it, so for example, when you are inside a volume that material changes from being a standard opaque one to a translucent one that enables the player to see through.

The trick is that I want that transition to happen softly, and not suddenly. At the moment I’m just stuck with using the “set material” node, which makes the change happen in an instant. Would you guys know of any way to do that?

Thanks for your time :slight_smile:

Not sure if there’s a way to blend between two actual materials as such.

But I’d generate a 0-1 float value outside the shader, describing how you get closer or inside your ‘volume’.
Then feed that value to inside your material to control one or more lerp’s between different controlling values of your material.

I recently did something similar using vectors to move a door from one position to another. It utilized a timeline to make the shift between the two locations gradual. It might be possible to adapt the method to what you’re trying to do, where instead of a gradual transition between two vector values it’d be two materials? Might be worth a look, here’s the tutorial I used.