+2 votes

I'm making a 2D game, and I want to add step sounds to the walking animation. Can I do that with key-frames inside the animation tab, so that the sounds correspond to the animation? I tried to use the AudioStreamPlayer but it doesn't seem to work at all.

in Engine by (89 points)

As far I know, you can call functions in the animationplayer. Add a call function track and populate it with keys triggering a function that play the sound in certain periods.

I never knew that! Gonna test this right now.

This worked very well! Thank you so much.

You're welcome.
: )

1 Answer

+2 votes

Totally possible. I created an animation with text being typed out accompanied by keyboard sound.

Typing Animation

  1. Create an AudioStreamPlayer and an AnimationPlayer.
  2. Click the AnimationPlayer to open the Animation tab
  3. Click + Add Track > Audio Playback Track
  4. Right-click on the track > Insert Key
  5. Click on the keyframe you've just created
  6. Load the sound file into the Stream property (That's it!)
  7. You might want to save it as a .tres so you can drag-n-drop it onto the track
  8. Or you can just copy it
by (4,209 points)

I don't see "Audio Playback Track" anywhere in the Add Track menu.
enter image description here

It's only available in Godot 3.1, I forgot.

That's OK, I've already found an answer. Thanks, anyway!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.