Skip to main content
‹ Back to Tutorials
Intermediate Unity

Unity Playmaker Adding Walking Sound to First Person Player

Mar 12, 2023
About this tutorial

In this Unity Playmaker tutorial, I'll show how to create a Sound Manager and set up an FSM for adding a walking sound to the first person player. ► Unity First Person Controller - https://assetstore.unity.com/packages/essentials/starter-assets-first-person-character-controller-196525?aid=1101lfDIN

Written Guide

This tutorial gives the first person player footstep audio that starts when they move and stops when they don't. Rather than bolting sound onto the player, it builds a dedicated sound manager — a two-state FSM that watches the movement input and toggles an audio source. Dedicated sound tools exist, but Playmaker handles this cleanly and keeps all audio logic in one place.

Create the sound manager FSM

Inside the game manager, create an empty called Sound Manager and add an FSM named player walking — name every FSM for what it does, since this object will collect several. Give it two states: Idle and Walking.

Read the move input

In Idle, add a Player Input Get Move Vector action pointed at the player capsule — that's the object carrying the first person character controller and its Player Input component. Worth a look under the hood: double-click the starter assets input actions and you'll see the move action checks WASD, the arrow keys, and the left stick, all producing a Vector2 value. Back in the action, pick the starter assets player move action from the list (there may be several — choose the right one), leave the map-to-plane X/Z setting as is, and store the magnitude in a new float variable called player move. Magnitude collapses the direction into a single number for how much the player is moving, which is all a footstep system needs.

Compare and switch states

Add a Float Compare checking player move against 0.01 — comparing against exactly zero is unreliable, and 0.01 guarantees actual movement. Send a walking event on both equal and greater than, add the transition, and check every frame. Then copy all the actions into the Walking state and flip the logic: same 0.01 threshold, but now transition back to Idle on less than, ignoring equal and greater. Every frame, each state is asking the one question that would make it hand off to the other.

Toggle the audio source

Add an Audio Source component to the Sound Manager with a walk loop clip. Enable Play On Awake and Loop — the trick is that "awake" applies to the component itself, so the loop starts whenever the source is enabled and stops when it's disabled. That means the FSM never plays audio directly; it just flips a checkbox. Drag the Audio Source component into each state and use Set Property on enabled: false in Idle, true in Walking. Press play — standing still is silent, moving starts the loop, stopping kills it the moment the state returns to Idle.

Unity tools by Bliz Studio
Built for our own games — now on the Asset Store

Multi Tag — unlimited hierarchical tags for any GameObject. Hierarchy Pro — style your whole hierarchy with rules. Made by a Unity dev, for Unity devs.

Explore our Unity assets →