Forum rules - please read before posting.

Footstep Sound - Finish Loop Before Stopping?

Hey there,

I've got some great stiletto-stepping footstep sounds in my game, but whereas they used to be very short in length, I've now added a spooky echo on them.

The problem is that the sound only plays as long as the key is pressed to move in that direction, and abruptly cuts the moment it is released. This is a lot more pronounced now that the echo has lengthened the sound.

Is there way to make the sound finish the loop it is currently in before stopping once the key is no longer pressed? Has anyone made this work? If it matters, I'm not using an advanced 3D character or anything like that, this is all in Unity Sprites...

Comments

  • Are you using the simple footstep sounds feature by assigning clips to the Player component?  If so, use the dedicated Footstep Sounds component instead - it has more options and won't cut out audio when the character stops.
  • Chris,

    That worked perfectly, thanks! Learned a little bit about Animation Events, as well.
  • For anyone looking for a way of doing this on a 2D sprite character that has worked well for me, I'm basically triggering the sound on beats 2 and 4 of my four-frame walk animation. Here's a gallery:


    Also, you'll notice that I've got the same SFX on both steps - this is because for whatever reason, trying to do it with just one threw some kind of array error in Unity, so I thought I'd just try making the array bigger and it worked. :)

    My only issue now, though, is that I only use these footstep sounds in certain scenes - when I was using the in-Player-script footstep sound, I would just use the Set Standard > Walk action to change it up as I went along. Chris (or anybody else), what would you suggest I do now? Just send a message to the sound child to turn off when I don't need it, or leave it off and turn it on when I do need it, or...?

    I only use it in two scenes. Rest of the time, no footstep sounds at all...




  • Actually, that probably won't work, because the Player is of course a prefab, and that sound object is nested way down...

    I don't know, maybe the best solution is to just make a separate version of the Prefab that has the sounds and one that doesn't.

    But damn, I gotta lot of Player prefabs now. If anyone has a more elegant solution, I'd love to hear it. :)
  • I think I'm using the same footstep script in my game. In scenes I want footsteps to be different I drop the player prefab in the scene, place different footstep sound effects in the slots and NOT click apply. So within that one scene the footsteps played will be those other ones ;) Just make sure you don't remove prefab from the scene.

    It's probably a silly way to do it, but it works for me ;)
  • I've been working on an Action that lets you change the footstep sounds.  I'll either post it on the wiki or include it officially.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.