I'm making platform game, So how can i change the player footsteps sound when the player above different floor's ( Steel , Grass ....etc)
I have one sound working on all floor's :
Player Skin animation = run
System-Trigger once ------------------Play Steps sound looping
Player Skin animation (Not equal) Run -------------- Stop Steps sound
Maybe check when collide with the floor type play the sound?
No, not working...
You can try working with triggers, by using sprites in a box shape. Just make different triggers for every type of floor and whenever your player sprite collides with the trigger for a wooden floor for example have an action that plays the footstep sound for a wooden floor.
I group my floor types into families (hard, soft, wood, water, etc) and then simply test if the player is touching an object in one of those families. I then have a subevent in my play walk sound event.
If animation= "running"
------>if player is overlapping "hard", play "hard sounds"
------>if player is overlapping "wood" play "wood sounds"
And so on.
Setting up an example for you
Here's an example how it can be done, I used poor sound effects tho. For better results use single step sounds.
You can also tag all the sounds as "footstep" instead of using a tag for each one. But it would delay a bit the sound when touching a different terrain.
(remove the space)
Thank's, but your example is not right, when the player stop moving the sound don't stop!!!
Develop games in your browser. Powerful, performant & highly capable.
slanw You should be able to fix that very quickly by just putting a stop sound action when they are not moving. You should be able to do that much if you have come this far.
Yes, I know that. It was just an quick example to show you how to get different sounds.
As BluePhaze said, you can just add a stop when player is not moving(better than checking for animation IMO).