Footstep Events Being Created And Played Twice

Hey there!

I’m learning FMOD using this video series. I’ve created the functions for detecting surface material and playing the event, created and tags for different surface materials, and attached my footstep events to character’s Running Animation. I can hear the audio and the surface material detection works correctly. (videos 10 and 11 of the playlist)

However when I ran the profiler, I noticed that some footstep events are created and played twice, with near-zero delays, and they’re noticeably louder. I can’t create these double-instances consistently as they seem to happen randomly. I’ve even tried to walk on the same spot repeatedly, but it produced random results.

I’ve also added Debug.Log to check whether it’s just a profiler bug or if the events are actually being played twice, and it confirmed the profiler’s output. I checked other events and they seem to work perfectly with only a single instance.

Is this behavior normal?

I’m using FMOD (Studio and Integration) 2.03.13 and Unity 2022.3.50f1 on Windows 11.

I’ll provide the script and some screenshots so you can see what’s going on.

This Script is attached to the Player’s Game Object with the Animator Component:

using UnityEngine;


public class F_Player : MonoBehaviour {
    
    
    private RaycastHit rayHitInfo;
    private float rayDistance = 0.3f;
    [SerializeField] private LayerMask selectedLayerMasks;
    private int detectedMaterialValue;


    [SerializeField] private FMODUnity.EventReference runEventRef;
    
    
    private const string EarthSurfaceType = "Earth";
    private const string GrassSurfaceType = "Grass";
    private const string PuddleSurfaceType = "Puddle";
    private const string StoneSurfaceType = "Stone";



    void PlayRunEvent() {
        MaterialCheck();
        FMOD.Studio.EventInstance runEventInstance = FMODUnity.RuntimeManager.CreateInstance(runEventRef);
        runEventInstance.setParameterByName("RunningSurface", detectedMaterialValue, false);
        FMODUnity.RuntimeManager.AttachInstanceToGameObject(runEventInstance, gameObject);
        runEventInstance.start();
        Debug.Log(runEventInstance);
        runEventInstance.release();
    }

    private void MaterialCheck() {
        if (Physics.Raycast(transform.position, Vector3.down, out rayHitInfo, rayDistance, selectedLayerMasks)) {
            
            switch (rayHitInfo.collider.tag) {
                case EarthSurfaceType:
                    detectedMaterialValue = 0;
                    break;
                case GrassSurfaceType:
                    detectedMaterialValue = 1;
                    break;
                case PuddleSurfaceType:
                    detectedMaterialValue = 2;
                    break;
                case StoneSurfaceType:
                    detectedMaterialValue = 3;
                    break;
                default:
                    detectedMaterialValue = 0;
                    break;
            }
            
        }


    }
}

In this picture, I delayed my single steps so you can notice the double-Instances in console.

And the profiler results of two events:

And My FMOD Event:

Player Game object:

Thanks!