Can't get Physical Materials to trigger footsteps.

Hi Guys,

For some reason I just can’t seem to get this system to work. I’ve been following the footstep triggering system suggested in this video here:

Essentially does a line trace, finds the physical material and then uses a map to set and fire a sound cue.

As you can see in the example video below, it works fine on the concrete ground (and I’ve verified it’s working by switching the sound from concrete to metal and back - so I know the system works here by using a line trace and referencing the map to play the associated sound). But for some reason when I go up the stairs it doesn’t work. I can’t figure out why - I have the stairs also set to its own physical material override so it should be hitting a physical material and playing the associated sound - but nothing.

I’ve isolated where the problem must be by using print string. It appears that, when the player is on the ground, the line trace is finding the map and firing the right sound, and it branches true. But when I attempt to go up the stairs, it becomes false.

I really can’t figure out why, so any help would be appreciated! I know I have the system set up correctly, so I’m either missing something blindingly obvious or something more finnicky I’ve yet to figure out.

Thanks in advance for any help you guys can offer!

Is the Line Trace getting a hit?
Are you getting a PhysMat from the hit result?
Do you have the right association in your Map? Are you sure? It’s possible to have two assets named the same and not be the same (short name vs. long name).

Hi Dan,

Thanks for your reply. Fairly sure it’s all working - if I switch the floor to play metal footsteps instead of concrete (or vice verse) it all works in principle. So I think the Physical Materials are set up fine and the line trace is firing and finding them - at least on the floor. I also think the map must be set up fine. At least on the floor static mesh.

It just seems the problem is with the other static meshes (the stairs and platform). I change the physical material slot to the relevant sound but it just doesn’t seem to find it. The problem must either be with it not finding the PM on line trace or not finding the PM in the map because the branch returns a false at that point - but then I don’t get why it all works fine on the floor mesh but not the other static meshes.

So I think I have discovered the problem (and it’s one I should have spotted sooner) - the stairs have “use complex collision as simple” selected, instead of using simple collision.

However, I’m having no luck getting any further. The PM override doesn’t work, and I have tried using various combinations with no success. Is there a way to use complex collision for the actual physics collision, and use simple collision for my PM line trace? I feel like whatever I do doesn’t yield the results I want!

I think you need to verify first that you are receiving the Physical Material reference from the Hit Result on the stairs.

If that is correct, then you will need to address the issue with your map.

If that is not correct, then that’s where the problem lies.

If you are doing a Reference Comparison for your Map Key, then make sure it is the exact same reference. There is already a selection of Engine Content PhysMat Assets with common names like Wood or Concrete. So if the name is Concrete and it’s your Concrete you’re looking for but you’re trying to find it and the Map is using the Engine content Concrete, then logically you think you should match, but you’re not.

Hi Dan,

Thanks again for your help so far. I think the video below is identifying the issue and answering some of your above questions. I have a print string set to TRUE if PM and associated map is found (it then branches to spawn sound attached) and FALSE if not, in which case it remains silent.

When a mesh’s collision is set to Project Default (simple and complex), the PM override works and I can get the sounds to trigger. But when it’s set to ‘Use Complex as Simple’ (which the stairs are set to) it no longer returns a PM. Changing the stairs to project default results in them no longer being accessible. I do not believe the map is set wrong or the footsteps would not change at all, or be incorrect. But you’re right that sometimes the PM is not found and that happens when the collision settings are different.

I’ve tried a few things I’ve found on the forums. Someone suggested setting the ‘Trace Complex’ to True in the LineTraceByChannel, but this did not solve the problem and of course meant even the meshes with simple collision no longer registered. Someone else had mentioned checking ‘Return Material on Move’, but this didn’t work and I can see why it wouldn’t for these static meshes.

My understanding was that the PM override would work but that’s not the case. Essentially I guess what I’m trying to do is use complex collision on some meshes for actual collision purposes, but for the purposes of my anim notify line trace, I just want to use what’s in the PM override box. The original tutorial I looked at seemed to work relatively straightforwardly but it’s not working at all here. I feel as if I’m being stupid and missing something simple but can’t figure out what.

Just as a continued update for anybody who may be interested. Funny enough I contacted the creator of the original tutorial and he’s been able to reproduce the problem in 4.25 (I’m on 4.24). It seems to be that when meshes are set to ‘use complex as simple’ for collision, the PM override no longer works (nor does inserting a PM into the simple collision box in the mesh window). And using “simple and complex” won’t work for collision purposes on some meshes (stairs being obvious cases in point). It would be great if I could find a way for my line trace to specifically use the simple collision and the player to use the complex collision for navigation/collision purposes, but this doesn’t seem to be possible, unless it’s just something I haven’t figured out.

There doesn’t seem to be a workaround that I can find. One workaround would be to assign PMs by material, but this won’t work for my needs because a lot of meshes in our project are using complicated material setups that share many materials - assigning one sound to one material will be too limiting.

I’ll keep exploring options but think it will be tricky. I’ve tried some random things - creating a new trace channel being one of them - but none of them have rectified the problem. Hopefully there will be a workaround as I’m aiming to avoid using box volumes or coming up with a whole new custom collision set or something, but so far it has remained elusive!

You could try using simple collision and just improving the collision mesh on the static mesh itself. Additionally, you could try just adding the PhysMat reference to the Material instead of always Overriding it on the Static Mesh Actor.