Hi, I'm working on a 2D game and I'm trying to change the footstep sounds in certain situations. I've followed the instructions in this link: https://adventurecreator.org/tutorials/giving-character-footstep-sounds
I've added the "Footstep sounds" component to a child object of my Player prefab and created a Trigger 2D with the "Sound: Change footsteps" Action.
The problem I'm encountering is that two footstep sounds are playing simultaneously: the 'default' footstep sound that I assigned in the Player component's 'Audio clips' - Walk sound, and the new footstep sound. https://imgur.com/a/sEENNje
What would be the best way to fix this issue so that only the new footstep sound plays?
Thank you so much!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I'll need to update the tutorial with the changes made to the Footstep Sounds system in v1.81 - thanks for the reminder.
However, this component is intended as an alternative to the clips assigned directly in the Player component. If you use Footstep Sounds to play sounds, unassign any clips in Player and rely on that only.
Thank you for the amazing product!
Understood, I’ll unassign the clip from the Player component. I just have one very minor concern: I wish I could set a default footstep sound so that I only need to create the Trigger 2D and Sound Action when it needs to be changed. But I’ll do some research to find a workaround for this!
I've updated the tutorial with details - the first-assigned Surface in the Surfaces window will be used as the default.
Thank you for updating the tutorial!
I have a quick question:
I followed the steps to change the footstep sounds, but I ran into an issue when switching scenes. The changed footstep audio keeps playing instead of reverting to the default clip (the first one in the Surface window).
Scene A:
Trigger 2D is set up and uses the "Sound: Change footsteps" action.
Scene B:
Scene B doesn't have a Trigger 2D with the "Sound: Change footsteps" action.
When the player switches to Scene B, the previously changed footstep sound continues to play instead of the default audio.
I tried toggling Addressables in the Settings Manager and the inspector of the audio clips, but it didn't make any difference. (I'm still learning about Addressables, so maybe I missed something there.)
However, if I add a "Sound: Change footsteps" action in the OnStart action list of Scene B and assign the default footstep sounds, the footsteps revert to the default in Scene B. Is this the correct setup, or is there a better way to ensure the footstep sounds reset to the default when switching scenes?
Here's my setup screenshot https://imgur.com/a/rYTfLJ5
Thank you so much!
If the Player is a prefab that's spawned in at runtime, that'll be the intended behaviour.
If you place your Player prefab manually into your scene files, they'll be treated separately - with default sounds reset. However, changes made to a spawned Player will survive upon switching scene.
If you want this type of Player to revert to the default sound at this time, the easiest way is to rely on the "Scene / Change / after" event - defined in the Events Editor - and have it run an ActionList that resets the Surface using the Action you mention adding to SceneB. This will then run automatically after any scene change - avoiding to create a separate OnStart for each scene.
Thank you so much for your response! You were right - my Player's position was being changed using Object: Transform. Once I removed that, the footstep sounds returned to default. My apologies for not testing it under clean conditions.
Also, thank you for the information about the Events Editor. I wasn't familiar with it, and it's a fantastic feature. Adventure Creator is incredibly intuitive yet offers a lot of depth. Thanks again!