How do you fade out a sound in Blueprint?

I have an object that moves in two directions . I want it so the object will play a sound while it is moving and the sound will stop when the object stops moving.

I can get the sound to fade in , but have not been able to get the sound to fade out. The sound volume should also vary depending how close the player is to the object .

Based on the image you provided I’m assuming your sound is just stopping immediately? This would be because the FadeOutDuration is 0. Set that to the period that you wish the time to fade out over and it should work.

For the volume varying based on listener distance to the sound you’ll want to use attenuation settings.

When I tried it before it would not fade out at all , the sound would keep playing. I will try changing the FadeOutDuration tomorrow.
Thanks

The attenuation settings work fine.
The Fade In node works OK on its own and the Fade Out node works fine on its own as well .
The problem happens when I try to fade in a sound then fade it out afterwards.

I’ve identified the issue and fixed it. It was caused by the call to FadeIn after the PlayAttached and the way that we clean up audiocomponents when they have finished playing. Thanks for the report.

youll need flow control for that.
compare to a bool value, if moving is true than play fade in
if moving is false play fade out

Where would I find this? I can find “IsMovingOnGround” , but this is not compatible with as static mesh.