- Home /
what is the best methode for footstep sounds? (3rd person)
i want to know what is the best method for syncing footsteps up with a 3rd person character? i have seen people use raycasts on the feet, sphere collider triggers on the feet and animation key frame slops. i have seen people on forums saying positive and negative things about all three.
I have experimented with using a raycast on each foot to detect downward distance collision and playing the sound when it reaches a short distance from the ground. This works ok but steep slops and quckly changing directions sometime cause missed steps or multiple step triggers.
sphere colliders seem a little better with less problems on slops.
I would stay away from any sort of sphere colliers, when you need precise controls it's not advised to use physics. Since you're using the animation why not add an event directly to your animation? https://docs.unity3d.com/$$anonymous$$anual/animeditor-AnimationEvents.html
Answer by tanoshimi · Nov 04, 2016 at 08:56 PM
I've always exposed a "onStep" animation event handler to the frame in which each foot lands on the floor. I then subscribe various delegates to this event that handle playing foot step sfx, leaving a footprint trail, or kicking up a dustcloud or making splashes in puddles.
Answer by alx1 · Nov 05, 2016 at 04:17 AM
i have decided to use animation curves. it's more work but it worth it, works great with the 2 animations i got it set up for right now.
Your answer
![](https://koobas.hobune.stream/wayback/20220612100046im_/https://answers.unity.com/themes/thub/images/avi.jpg)