0
Answered

How to make a Foot Steps.

Olga 2 months ago in Other updated by Dornano 2 months ago 5

Hi! Is it possible to make a foot steps? Like in "Invector " for example they have a foot tracks with  sounds depending on materials.

Thank you!

Unity version:
2019.4.1f1
Game Creator version:
1.1.9
Answered

There's no dedicated system for footsteps, but you can build your own quite easily. There's a Trigger called "On Step" that is executed every time a character does a step. You use the Play Sound action as a result of that to play a sound effect when the Trigger is fired.

However, if you want to have multiple types of sounds, I'm afraid that will require either creating a custom Action to detect the material below and play the according audio clip, or use volumes to detect where the player is (if it's water, play a water splash, etc..)

Ok. Thank you Marti. 

+1

I had the same goal. I didn't manage to make it works, but I'm sure it's the good way to do it:


-I put a tag on each surface of my level: wood, metal, tiles, water...

-I created a String variable called "floor type".

-I attached a trigger on my Player's foot.

-In this foot triger, I added a "On Tag Enter" and "On Tag Exit" triggers for each type of floor I have. When the foot trigger enters in a surface with the tag "wood" for ex, it sets the string variable on "wood".

-Then I put the On Step trigger: each time the Player do a step, it checks Condition: if my string variable is set to "wood", it picks one wood step sound in a List. I made another Condition but with the clause "If string variable is set to metal", and another one for tiles etc.


It works fine for 2 types of floor, but to be honest, it doesn't work if there is more.I still don't know why.
But maybe this try can help you anyway?

Thank you very much. I will try it. 

+1

Please let me know if you find something ^^