Need help with walk cycle sounds

Hi,
I have 4 sound files for footsteps (The same way Source Engine does their footsteps). When I press W, I want it to play any random one of these 4 sounds and then repeat any of the sounds while W is still pressed. How do I achieve this using logic bricks? Could I use a random sensor?

Thanks

bump…

Use a python script and create random number between 1-4. Then assign each sound to one of the values

make sure you import random at the beginning of the script.

http://docs.python.org/library/random.html

ull need to import random before using one of these

http://docs.python.org/library/random.html

I suck at python, that’s why I asked if anyone knows how to do it using logic bricks.

The attached file should resolve half portion of the issue.
it uses a random actuator.:wink:
Like AzulBaronis said python will be easier sine you can control audio with audaspace module and keyboard events with a script. But the equivalent should also be possible with logic bricks.

Attachments

random.blend (405 KB)