Fade Material over time with BluePrint

This instance of a material can fade out over time. First make a material. Mine is all shiny etc that doesnt matter,  the important part is that the material is masked and the Noise is attached to the Opacity Mask. A scalar parameter has been subtracted from it called Blend Value. This is defaulted to 1  – so no Noise. As the param increases to 1 the noise mask makes ‘hole’s in the material. At 1 the material disappears fully. This isn’t a transparent fadeout, which would not work on an opaque material, its more like a diffusion effect.

Blend Material

In Content Browser, you can choose the Material and R-clcik, Create Material Instance. This makes an instance that looks like this and you can see the BlendValue Parameter.

Blend Material Instance

Ok this Blend Material Instance is applied to a BP_sphere. And in the Blueprint I do a few things. (There’s a whole part of the BP that takes input to move the sphere but lets ignore that for now, and just look at the blend part)

 

Initial setup, we double check the material is the ‘BlendMatInstance’ we set up earlier

 

Checks the Z height of the sphere, when it’s high it triggers the Blend, if it’s low and Transparent (Blend Amount = 1) then fade it in.

When the ball is spawned the ‘Blend Amount’ float is at the default, 1, fully transparent which forces the Timeline to play backwards fading it in.
(In the actual Blend Material Instance itself the default Blend Value is 0 (fully visible) so you can see it if you place the Sphere_BP in a level rather than spawning it. On play or spawn my ‘Blend Amount’ float variable immediately makes it invisible and then fades it in -neat huh!

Heres the Blend. A custom event – triggers the timeline (of 5 seconds) that has a keyframed ‘Blend Value’ – that affects the material fading it. The ‘Blend Amount’ gets set to ‘Blend Value’ so we can check to make sure it’s not already faded out. If it is, the ‘Reverse from End’ plays the Timeline backwards, fading the thing in.

Here is the whole of the blending part of the BP, sorry if this seems convoluted.

Blending part of the BP