Simple Footstep question

Hey, this might be a very simple question but i cant seem to find the answer in the internet, i just crated a very simple script which i attached to a character running animation in unity so it plays the footstep sound event i created in FMOD, the thing is the sound plays, but it wont stop playing even when the character dies. I tried two ways:

  1. public void PlayerFootsteps()
    { footsteps = FMODUnity.RuntimeManager.CreateInstance(“event:/Footsteps”);
    footsteps.start();
    footsteps.release(); }
  2. Same method but with this inside {FMODUnity.RuntimeManager.PlayOneShot(“event:/Footsteps”);}

Hope this is not a mess of an explanation. Thanks in advanced.

Is your FMOD event (ie. look in your FMOD project) a looping sound?

Or in what way do you mean that the sound “won’t stop playing”?

hey thanks for answering, its not looping that was actually my first thought. It just wont stop playing the sound, its tied to two key frames in the animation of the character but the sound even plays when the character is not n that animation.

Check if that method is still be called when the animation is not playing with a Debug.Log() line. Then you know if the problem is in the animation still looping or so.

Oh ok good idea let me try that.

Are you sure the method is PlayerFootsteps method is not called every frame? It sounds like that could be it if you’re sure that it’s not a looping sound as you mentioned earlier.

I checked all that everyone said and as far as i know (which is not much) i looks its not calling the method every frame, since i only added those two events, dont know if im missing something.

Thanks in advanced.

And heres the actual FMOD event.