You need a post process effect.
I’m not sure you have access to distance from nearest surface within it - or the object pivot.
If you don’t have access, its still pretty simple.
make a material parameter collection with a v3 locatiom, make a blueprint, and tie the value of the v3 location to the location of the post process pivot.
Then you use that value which is in world space, to perform the math that generates the effect based in worldspace distance from the variable.
If you add volumetric fog onto it, you should be able to achieve the same effect.
If you need the value of the PP bounds to use as a distance and object bounds isn’t a thing inside the pp material, use the same trick as before. Create a v3 in the pp material, and make the BP keep track of the bound size.
Basically follow this for the base of the PP material
if you want to learn more volume effects try this one