Playing sound while button is down

Get help using Construct 2

Post » Thu Feb 27, 2014 7:53 am

I have space ship with multiple thrusters, i need to play thruster sound from activated thruster while button is down.
Creator of MiniDayZ
B
22
S
2
G
2
Posts: 75
Reputation: 1,858

Post » Thu Feb 27, 2014 8:55 am

On key pressed -> Play the sound with tag "thruster" looping
On key released -> Stop sound with tag "thruster"

Try this and tell me !
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Thu Feb 27, 2014 7:25 pm

Joskin wrote:On key pressed -> Play the sound with tag "thruster" looping
On key released -> Stop sound with tag "thruster"

Try this and tell me !


I already tried this, it starts play every tick while button is down (starts a new sound every tick)
i need while button is down file "thrust_sound" playing, when released it stops
Creator of MiniDayZ
B
22
S
2
G
2
Posts: 75
Reputation: 1,858

Post » Thu Feb 27, 2014 10:38 pm

Add a sub event to key pressed, trigger once. Set the effect looping. On button released, quit playing.
Image
B
20
S
4
Posts: 382
Reputation: 2,964

Post » Fri Feb 28, 2014 10:29 am

Farsight wrote:
Joskin wrote:On key pressed -> Play the sound with tag "thruster" looping
On key released -> Stop sound with tag "thruster"

Try this and tell me !


I already tried this, it starts play every tick while button is down (starts a new sound every tick)
i need while button is down file "thrust_sound" playing, when released it stops


Impossible, the "On key pressed" condition trigger once.

Did you really try what I said ?

https://www.dropbox.com/s/8vdzm8xoglstp44/music.png
B
39
S
15
G
5
Posts: 295
Reputation: 6,089


Return to How do I....?

Who is online

Users browsing this forum: SputnikCZ and 2 guests