Need help with walk cycle sounds

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?



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.

ull need to import random before using one of these

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.


random.blend (405 KB)