0
Under review

How do we add footstep?

JuliaK 2 months ago in Game Creator updated by Borna Ungar 2 months ago 10

Everything is in the question :) If I add a sound, it does not play it in a loop. So, I guess there must be another method.

Unity version:
Game Creator version:
Answered

Sounds are not meant to be used in a loop (that's what Music is for). Doing footstep is quite easy. You can create a new Trigger and look for the option "On Step". Each time the character does a step, it will call the following actions.

You can choose to trigger this for any of the legs of the character (I'd recommend this one), or, if your character has, for example, a metallic left leg, you can play different sounds depending on which leg is performing the step.

Cheers!

I put the Trigger on. Character: Player. Step: Any

Action: Play sound

The sound plays and then stops as my player continues to walk.

On another scene, the sound works. But, in the 1st scene, I have a cutscene before and there, the sound of steps no longer works.

Under review

When you say you have a cutscene, you mean a Timeline cutscene or you have made a cutscene using Game Creator? I don't see any reason why the footstep system shouldn't work. Try adding a Debug Message action as the first action and see if the Action after each consecutive step is called. This will narrow down the problem.

Also, make sure that, if you're using custom locomotion animations, set up the necessary events to detect steps. Game Creator's animations already come with these, but you may need to manually set them for any custom ones. Here's more info on this: https://docs.gamecreator.io/game-creator/game-creator/characters/advanced/ik-in-custom-animations

Once I had a question "Random jump sounds"(in this forum). I did the same for the steps.

Eagleeyez help me.

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.

Yes, it's a Timeline cutscene. That's what cuts the sound.And, i don't use custom locomotion. 

But how are you moving the character in the cutscene? If it's using the Move Character To, adding the Trigger "On Step" will play the sound automatically. If you're playing the sound moving the character using Timeline (animating the transform), then it has little to do with Game Creator.

Can you post some screenshots and explain in detail what you're doing?

The cutscene shows a car arriving and parking. The player is not controllable. Change of camera. The player is controllable and goes to an NPC to start a dialogue.

I apologize for my bad english :)

But are you moving the Character using the Move To Action? If you're animating the character directly from Timeline, then that's the problem: Timeline simply animates the transform property of an object. If you use the Move To Action, you will signal a character to move to a position, which involves many more systems, including the foot steps.

See images attached below.

I have a similar problem. I've put Debug and PlaySound as Actions for Trigger on Step. The situation is as follows:

1. Debug message works so it does register steps but no sound

2. Its set to Any, but it waits for 2 steps and then it counts as 2 steps ( adds 2 messages to debug ) instead of sending the message after each step. That part I wouldn't mind since its a fps, but I don't know why it won't play the sound. Other sounds unrelated to this trigger work so it's not a Listener problem I guess.