Calling Footstep Events from Animations
Using Unity and Wwise
The last key element our game needs is some noise from the Player. Being a thief, sneaking through a museum, it makes sense for our footsteps to be the defining feature, making every step seem like a risk, putting the User on edge.
In Unity’s Animation window, we can create Animation Events that can call method’s from scripts attached to the same game object. Keying these in on the frames where the player’s feet touch the ground, can allow us to send a message to Wwise, and play a footstep event.
I created a quick FootstepPoster script, that takes a Wwise Event, and passes it to our AudioManager within a public method. This method needs to be public for our animation to call it.
On each Animation Event we keyed, we can simply access the created function.
Now as our Player moves around, we can connect the Wwise Profiler and see our Wwise Event being called in time with the feet touching the ground.