Play Audio At Specific Object Instance

Get help using Construct 2

Post » Fri May 03, 2013 9:59 pm

Is it possible to set an audio file to play from a specific instance id or unique id for an object? In this situation I have pairs of sounds (ie "bang" & "poof") that I would like to come out of a single instance of an object (ie "ExploderObject"). It might look something like

Play "bang" not looping at volume 0db at object ExploderObject[1] (inner angle 360, outer angle 360, outer gain 0dB) with tag "bangsound"
Play "poof" not looping at volume 0db at object ExploderObject[1] (inner angle 360, outer angle 360, outer gain 0dB) with tag "poofsound"
B
8
S
2
G
1
Posts: 12
Reputation: 1,349

Post » Sat May 04, 2013 1:54 am

do you mean to have the odd instances play say poof
and the even to play bang?
B
39
S
10
G
7
Posts: 514
Reputation: 9,426

Post » Sat May 04, 2013 3:13 am

No, I want a single instance of ExploderObject to play both poof and bang. The reason I'm looking for this is so that the stereo positioning of poof and bang both come from the one instance but I'll still be able to feed set volume and effects through their separate tags - poofsound and bangsound.

Another way to accomplish what I'm looking for would be a "set position" action where I could set the x and y position of a sound by tag name. However, as far as I know, that function is available.

Any insight into either of these would be great. Thanks.
B
8
S
2
G
1
Posts: 12
Reputation: 1,349

Post » Sat May 04, 2013 3:22 am

You just pick the instance you want first, then play at that object.
ImageImage
B
66
S
19
G
121
Posts: 3,195
Reputation: 72,852

Post » Sat May 04, 2013 5:18 am

YES! Some of the simplest things are so hard to find. I had almost given up hope of thinking it was even possible. Thank you very much.
B
8
S
2
G
1
Posts: 12
Reputation: 1,349


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests