I Hear Footstep- Game Dev Series 119

Objective: create footstep by using Animation Event.

In the previous article, we have created single audio system by using AudioManager. Today we are going to play the footstep audio to all of walkable creatures in game.
We will use Animation Event to help us finishing this function.

Footstep script

Create a new script and call it FootstepAudio.
Within this script, we will only need to call the AudioSource to play the footstep audio when the animation is stepping on the ground.

With this script, every gameobject with Animator should also add an AudioSource component into it.
Let’s do this part to Player.

AudioSource setting

Select Sprite gameobject under Player(which is where we control the animation with Animator). Then add an AudioSource component and FootstepAudio script.

Drag the footstep audio file into AudioClip column, then disable Play On Awake.

Once done, we can make the running animation to run with footstep sound.

Animation Event

Open Animation tab of Player(by selecting Sprite gameobject), and select Run animation.
Dragging the timeline marker to where the Player has stepped on the ground, then click Add Event button.

It should look like this.

Now select the event marker, and select the method we created in FootstepAudio script as calling event.

Now we have successfully assigned the footstep sound to the running animation.
Play it and check the result!




A passionate gamer whose goal is to work in video game development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building a Nutrition Info App with Microsoft PowerApps using static Excel data

Nutrition app in PowerApps using Excel static data — Cloudatica example

What is the opportunity cost of Life?

Features of Java

How I found writing in Kotlin for Android

SpringBoot with gRPC — Fast Start Implementation

TwitterTrack — tracking tweets using Tweepy #BeginnerProject

What About Private Cloud?


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
S.J. Jason Liu

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.

More from Medium

Initializing Ads on the Main Menu

Day 103: Creating A Ledge Grab in Unity Part 1

Creating A Timed Run Challenge In Unity

How I used scriptable objects to build a powerup system