How do I Set a Sound Effect To A Specific Animation Frame?

Just started using Construct 2? Post your questions here

Post » Mon Jan 04, 2016 3:40 am

My sprite has several animations, and I'd like to begin adding sound effects to each of them at specific frames. However, the Audio action that I add after an event doesn't seem to have any options for that?
I found something called Compare Frame once (Of course I can't find it now) but it only had options for the current animation, which I'm guessing is the default, which is not the one I want.
B
7
Posts: 51
Reputation: 379

Post » Mon Jan 04, 2016 8:13 pm

"Compare Frame" is a Sprite condition. You can combine that with the "Is Playing" condition to check the animation as well.
B
55
S
28
G
18
Posts: 1,520
Reputation: 25,305

Post » Tue Jan 05, 2016 12:15 am

I'm so sorry, but I'm extremely ignorant about all this. Can you be more specific? How should I set up my events sheet so that "SoundEffect" plays on Frame 10 of "Walking" animation, when "Walking" is not the default animation?
B
7
Posts: 51
Reputation: 379

Post » Tue Jan 05, 2016 1:35 am

Hey there,

Here's an example for you:
Image

In this example, you'll notice that I have a "once (while true)" qualifier in there. That's because this sprite only has one frame and is used as a backdrop. The method for your purposes is, otherwise, the same. If your animation is at "walking", compare frame to "10" and then set your sound to play.

If you haven't done it yet, you'll also need to add the audio object to your project and import your sound.
B
42
S
26
G
22
Posts: 307
Reputation: 15,141

Post » Tue Jan 05, 2016 3:53 am

OH GOD IT WORKED!!

(New Event) > Player: Is animation "Walk" playing |
>>Player: Animation frame = 10 |Audio: Play "Footstep" not looping at volume 0 dB (tag "")


Thanks!
B
7
Posts: 51
Reputation: 379


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest