I’m using the same setup, I just have one for the left and right foot so I use get socket location instead of actor location, maybe it comes from the try to get pawn owner node.
Try get a ref of your actual character.
I’m trying to make footstep sounds based on the physical material type the player is stepping on using a line trace as described here:
That thread has been shut down by Staff saying it is an old post and much of the information may have changed. I’m still trying this line trace technique because I don’t see any updated posts about this.
So I have anim notifies when the characters foot touches the ground and I respond to those in my animation blueprint. First we do a line trace from the actor location into the ground. At the bottom right you see we call “Get Surface Type” and from there we are supposed to plug into a Select node (to choose the correct sound based on that surface type) and then into a PlaySound node.
But for testing purposes I am switching on the surface type and printing a debug message. The problem is that its not detecting the right surface type.
I added 2 new surface types in Project Settings > Physics. Then I created my Physical Materials for those by right clicking Physics > Physical Materials in the content browser and associating them with the surface types. Then I opened my Landscape Material and set the Physical Material and saved.
In my level editor I’ve clicked my sidewalk mesh and under Collision > Physical Material Override and set one of the physical materials I just created.
The problem is that it never returns the correct surface type. Where am I going wrong?
If there’s updated information on how to do this as the old post suggests, please include it here for people finding this post later on.
I think I figured out the problem. Instead of setting physical material on landscape material as a whole I set it in the LayerInfo files used in the landscape. Then if you go into the static mesh editor there is an option for Simple Collision Physical Material. It seems to be working now.
Thanks for the tip about the get socket location for the foot bones. Probably more accurate than tracing from GetActorLocation().