Play Specific Audio While Sliding in Surface

Hello, Geniuses!

I’m having a terrible time trying to play the audios I’ve created for one of the pawns. I’ve created a CUE and when I try Spawn Sound at Location everything works fine, it recognizes the surface it’s on (Switch on EPhysicalSurface), plays the CUE brilliantly but it just doesn’t STOP in sync. Whenever the ball runs out of the Cardboard (let’s say), it continues to play the CUE until the end of the audio, which makes it almost a second late. Don’t think this is important but I’ve done it all after Event Hit.

Believing that the problem is on the STOP (Audio Component) node, I’ve decided to create a Audio Component for this surface in the ball. Now it plays really weird, not continuously… I’ve
done a simple Play for Audio Component, and Stop when the Switch on EPhysicalSurface goes back to default.

Have watched many tutorials, nothing solved yet. Cheers! Thank you!

I found the most controllable way to make sound is to use ‘spawn sound attached’, followed by ‘stop’. The sound reference is an audio component.

Of course, you have to make sure you’re only spawning the sound once, either by checking the reference, or using a DoOnce.

That’s good advice, the DoOnce really made the difference. Thanks! Now I can easily stop the sound when the Sphere touches another mesh of different material. But what would you do to make it stop when it’s in the air (bouncing, not hitting the valid mesh anymore)?
I’ve tried to link the stop to an EndOverlap event (with a sphere trigger radius slightly bigger than the sphere mesh), it works on the first bounce or even second, but then after the ball keeps bouncing and the noise (audio component) keeps playing the rolling sound since the EndOverlap only triggers again whenever the ball leaves the valid surface and comes back…
That’s weird. Any help? Cheers!

I think you might need to do the surface check with a line trace rather than overlap. Then you can look every tick.

Thanks for your time! I’ll do that, makes sense. Cheers!

1 Like