How to have a sound cue follow a PlayerController along a spline?

Using UE 5.1

Much easier to play the sound at the player location. Having said that, if you could get it to exactly follow the player, it would have the same effect as just using ‘play sound 2d’, so why not use that? :slight_smile:

Can you share more specifics about your scenario? Where is the spline in relation to the player?

So I used this video as a guide to construct the spline and attach audio to it: Spline Based Audio For Unique Shapes | How To Add SFX To A River - Unreal Engine Tutorial - YouTube

Basically my ThirdPersonController is running along a river, and I’m trying to detect the player’s location and have the sound cue (playing a river sound) follow the player as he runs alongside it.

I know the video is in UE4, and I’m wondering if that’s the reason why it’s not working. Should I have used UE5’s water plugin instead?

The water you use shouldn’t matter since the audio spline the tutorial has you create is just being placed over the top of the river. I don’t think there’s anything that needs to be different for UE5 from the tutorial.

Can you describe what’s not working? Is the sound not playing at all? Is the sound playing but not moving along the spline?

You just need to drop some sound cues of the water flowing, at regular intervals along the river.

The sound cue is working, it’s just not following the player as he’s walking alongside the river. I’ve copied the blueprint in the video, so I’m not sure what the issue is.

Can you share a screenshot of your blueprints?

Here is an image of the event graph.
Spline is the spline component, and Water is the audio component.
On the “Find Location Closest to World Location” node, I’ve switched coordinate space between Local and World; neither worked.

Your “SetWorldLocation” node isn’t connected properly. It should be connected to the red “MoveAudio” custom event on the left, not the blue event call node.

That’s it! Thanks so much.

1 Like