0
Answered

Random jump sounds

Pandar 9 months ago in Game Creator updated by Marti (Lead Developer) 8 months ago 4

Hey. There are 7 audio files of sounds made by the character when jumping. Could you please tell me how to make the character make one of these sounds during the jumps in random order?

Unity version:
Game Creator version:

Answer

+1
Answer

You need to use a list an action called execute action from a random value in the list

  1. Create a List in your Hierarchy by either right click, gamecretor, variables list or just click on the floating bar in the scene view on list variables.
  2. Now make an empty game object in your hierarchy and call it my jump sounds.
  3. Create an action also from the floating bar or right click in the object and call it play sound 1
  4. Add an action called play sound and select the first sound of your sounds.
  5. Duplicate this game object within your jumps sounds and give it your second sound to play.
  6. Do that for as many sounds you need.
  7. Now go into your list variables and add a game object. Drag the first action you made in your jump sounds into this field and then create the next list game object for the second one and so on for as many as you need
  8. Now create a trigger in your hierarchy and call it jump Trigger
  9. Change this trigger name to key down space.
  10. Add an action and find the action execute action
  11. Change this to variables and not actions
  12. Select list and drag your list into the field.
  13. Select then in the drop down random value.
  14. That is it now each time you press space you will jump to one of your random sounds.
+1
Answer

You need to use a list an action called execute action from a random value in the list

  1. Create a List in your Hierarchy by either right click, gamecretor, variables list or just click on the floating bar in the scene view on list variables.
  2. Now make an empty game object in your hierarchy and call it my jump sounds.
  3. Create an action also from the floating bar or right click in the object and call it play sound 1
  4. Add an action called play sound and select the first sound of your sounds.
  5. Duplicate this game object within your jumps sounds and give it your second sound to play.
  6. Do that for as many sounds you need.
  7. Now go into your list variables and add a game object. Drag the first action you made in your jump sounds into this field and then create the next list game object for the second one and so on for as many as you need
  8. Now create a trigger in your hierarchy and call it jump Trigger
  9. Change this trigger name to key down space.
  10. Add an action and find the action execute action
  11. Change this to variables and not actions
  12. Select list and drag your list into the field.
  13. Select then in the drop down random value.
  14. That is it now each time you press space you will jump to one of your random sounds.

Cool! Thanks!

Glad I could help,

but to the dev it would be great and much simpler if we would also just make a list of sound files and then have an action that plays this list by index or random. Thank you.

Answered

Thanks EaglyeEyez for a detailed answer! Kudos to you!