Play Sound at Location does not work on complex meshes

EDIT: Spawn Sound at Location does not work either.
EDIT 2: Play 2D Sound did not work either. Mesh collision types have been changed and tested and nothing seems to work.

Hi guys,

I’m making a simple footstep detection system that uses LineTraceByChannel to check the distance between the foot bone and the ground, whereupon a sound will play when the foot makes contact with a properly tagged surface. However, there appears to be a bug in which the PlaySoundAtLocation function does not run when hitting a complex mesh.

I’ve tested it with Unreal’s basic meshes and no matter the size, the sound triggers properly. However, when I use any complex meshes, including the stairs and platforms that came with the Third Person Level, every other bit of code that runs on impact runs as it should but the sound does not play. I’ve tried debugging and testing on different variables, and I’ve already made sure that the meshes are set up with proper collisions, generate overlap events and even checked the Physics Material. Even switching to a collider-based system did not solve the issue at all as the sound still refuses to play, but according to the simulation visualizer, the function is actually called and runs as intended.

To clarify, I’ve checked this issue with a variety of meshes and the only time it actually triggers was when I stepped on basic meshes provided by the editor, even when the mesh in question have been set up following those basic meshes. Size has proven to not be a factor, and it shouldn’t be as the location detection uses the impact point of the line as the location to play the sound at. For further clarification, the system is created for sequencer use so that the sound properly comes out during animation and rendering without having to stress over the timing details of putting in the footsteps. However, I also tested this with a third person game mode and the same error occurs.

If anyone has any suggestions, solutions or workaround, do comment down in the replies. Thank you in advance.

The problem has been resolved. Turns out the mesh collisions need to be set to Use Simple Collision as Complex and that got the whole system to work properly. It didn’t work the first time when I changed the collision modes due to my oversight. I’m sure that I accidentally reverted it to Use Complex Collision as Simple before saving it, so it wasn’t a bug but a human error.

Thank you very much for the response!

328951-staticmesh-collision.png

Reading what you’ve put there, it sounds like you just aren’t playing the sound. I mean, whether or not the sound plays can’t possibly be based on the nature of the mesh, it must just be that you’re not calling the play node.

Can you show the code?

Therein lies the issue that the node was called, as shown during the simulation and debugging, but the sound refuses to play when the hit object is not a simple object from Unreal’s basic shape library.

This is the slightly updated version I’m using for documentation, but do note that before, there was a Print String node after the Set Right Stepped node, which still fired off correctly despite the sound not playing.

EDIT: The code currently only shows Play Sound at Location but I did switch it out with Play 2D Sound and Spawn Sound at Location, and neither of these 3 works. Same case with all of them - the rest of the code runs, and the simulation shows it being called, but the sound simply doesn’t play when it hits a complex mesh but plays properly on a standard basic shape object.