How do I PLAY only once per action/animation?

Get help using Construct 2

Post » Fri Feb 28, 2014 12:59 pm

Hello Everybody,
I'm new to C2, I just started to mess around to learn it, so far I mad what I like but I ran into a problem that I don't know how to solve.

I've created an event when a button pressed it changes to JUMP animation and play a sound, same goes for the SHOOT animation. (different button of course).

The problem is:
When I press UP the character will jump once and land which is great, but while in the air... if I click many times the sound will play many times.

I want it to play only ONCE when I jump, or when I shoot so even if I'll press UP many times in a raw it will play the "jumping sound" only once.


Sorry about my bad English and thanks ahead for the help!
B
10
S
1
G
1
Posts: 40
Reputation: 755

Post » Fri Feb 28, 2014 1:17 pm

Make a condition:
Sprite not is playing "JUMP": play sound
Then make the character jump.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Fri Feb 28, 2014 1:37 pm

Thanks for the fast reply,
Maybe I did this all wrong:

Hero >> Is animation "Jump" playing >> Play Audio "Jumping sound"

Now no sound while jumping, I did try to look for what you typed but I'm a bit lost, because I'm still new to C2 after all.
Any chance for a screenshot or example file please?
B
10
S
1
G
1
Posts: 40
Reputation: 755

Post » Fri Feb 28, 2014 1:43 pm

Hero >> Is animation "Jump" playing >> Play Audio "Jumping sound" - this will play audio file constantly. If you want to do it that way it should look:

Hero| Is animation "jump" playing
> Trigger once -> Play Audio file - this is sub-event
ImageImageImageImage
B
158
S
66
G
43
Posts: 2,603
Reputation: 35,868

Post » Fri Feb 28, 2014 2:01 pm

shinkan wrote:Hero >> Is animation "Jump" playing >> Play Audio "Jumping sound" - this will play audio file constantly. If you want to do it that way it should look:

Hero| Is animation "jump" playing
> Trigger once -> Play Audio file - this is sub-event


Thanks shinkan,
I tried to do what you explained, I may be wrong... where did I go wrong?

Image
B
10
S
1
G
1
Posts: 40
Reputation: 755

Post » Fri Feb 28, 2014 2:05 pm

Like this
but your event should work too.

If it's not working issue is somewhere else.
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
158
S
66
G
43
Posts: 2,603
Reputation: 35,868

Post » Fri Feb 28, 2014 2:17 pm

I have no sound when jumping now.
maybe you can see what I did wrong in the screenshot?

*The marked event is not make any difference, with or without it... still no sound.

Image
B
10
S
1
G
1
Posts: 40
Reputation: 755

Post » Fri Feb 28, 2014 2:21 pm

Set animation "Jumping" playing

is animation "Jump" playing.

Jump is not the same as jumping
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Fri Feb 28, 2014 2:26 pm

@lennaert what he said. You are setting one animation to play, but check if different one is playing.
ImageImageImageImage
B
158
S
66
G
43
Posts: 2,603
Reputation: 35,868

Post » Fri Feb 28, 2014 2:28 pm

Thank you guys for your patience with my confusion...
I'm trying to be organized and still messed up... hope I'll get better in this, it's my very first try in C2.

OK, so I fixed the "jumping" which is a tag for the sound to the "Jump" which is the name of the animation.

Now the very first Jump (Up pressed) is working, and that's it... no more jump sounds, I think it's something to do with the trigger once... I'm trying to play with it's order or something.
B
10
S
1
G
1
Posts: 40
Reputation: 755

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 31 guests