- Home /
Mecanim Animation events fires multiple times
Im trying to use Mecanim animation events to play footstep sounds when the feet touches the ground. I have a blend tree with walk, jog and run animations, and i have added events on the right keyframes when the feet touches ground. The event method only fires the sound.
Now this works perfect for the walk animation, but when the character jogs or especially runs, the event method is fired multiple times.
Answer by itsmars · Dec 23, 2015 at 09:51 AM
@Heffalus A blend tree flattens Animation Events. Notice in the picture below, while I'm running down and to the right, four animations are circled in blue. That's four footstep sounds each time my foot touches the ground.
I recorded a detailed video tutorial on how to use Curves, instead of Animation Events. You can also download my full script for free.
I assume you're using curves since they can all modify a single variable - eli$$anonymous$$ating multiple redundant footsteps - and then a function just checks the variable against a threshhold value to create one footstep per cycle? But I would think that several animation clips modifying the same variable could cause the variable to always average out below the threshold, preventing any footsteps at all?
Your answer
Follow this Question
Related Questions
How to create a system for tracking player progress/events 1 Answer
Can I set a specific Pointer for the EventTrigger on Buttons for example? 0 Answers
EventSystem events reaching parent EventTrigger? 0 Answers
How do you fill an EventTrigger from a script? 0 Answers
How to transition at fixed points in Mecanim? (ex. Footsteps) 0 Answers