Hi, I am currently trying to get a footsteps track to play while I move through a scene (FPS). I have seen a lot of scripts on the forums but I dont know how or where to place these - any help would be greatly appreciated as I have never done any kind of scripting, really need a step by step! Thanks Dave
asked Oct 01 '10 at 12:52 PM
This question is really quite general, but I'll try to be as specific as I can.
Going through the tutorials and checking out their setups is a great way to start. I recommend checking out the 2D platformer tutorial specifically as I know that it has sound on footfalls.
Their setup has the following:
It is possible that your FPS doesn't actually have a player character but a camera floating in space. In this case, you would have to decide how and when to trigger your sounds.
To play audio, you can do something like:
You would do this whenever you move. You could do some boolean checking (as a lock) to prevent playing the sound too frequently, possibly with a coroutine to wait a specified amount of time or something to control the flag.
answered Oct 01 '10 at 04:14 PM