Hi there, I’m loving FMOD so far, however I can’t seem to get it to work with the footsteps of my character. I attached a simple script to the character, which basically triggers a oneshot from FMOD on the animation event once the character hits the ground. however, once the character stops walking, the oneshot keeps repeating itself. this is the script:
public class FootstepsAudio : MonoBehaviour
public string inputsound;
public void PlaySound()
FMODUnity.RuntimeManager.PlayOneShot(inputsound); //This sound plays when Enemy is hit
I hope anyone can help me out,
Thanks in advance!
Have you checked your animations? This sounds like the animation containing the animation event is running even when your character stops walking.
Thank you for your reply, I checked and my character goes to the idle animation after stopping. But could it be because I’m using a blendtree? That it somehow still slowly plays the animation in the background or anything?
Yes I think it’s due to the blendtree, since if I don’t use a blendtree for my player and seperate the idle and run animation, it doesn’t happen.
When using blend trees, all animation events are called. You can maybe work around that by checking for the clip weight, see https://forum.unity.com/threads/mecanim-5-blend-tree-animation-event-called-twice.318747/