How do I give each instance a different sound?

Get help using Construct 2

Post » Sun Dec 27, 2015 11:13 am

Hi guys, like the title suggest how do i add different sound to each instances.

Lets say i have 10 instances of a circle.
when i click on a circle it will play it will play a sound that has been assigned to it.

can someone help?
B
6
S
1
Posts: 43
Reputation: 492

Post » Sun Dec 27, 2015 3:54 pm

desasteraang wrote:Hi guys, like the title suggest how do i add different sound to each instances.

Lets say i have 10 instances of a circle.
when i click on a circle it will play it will play a sound that has been assigned to it.

can someone help?


You can try this method...

First, add an instance variable of the circle named "Signature" that return a text value.

Second, Assigned each circle with their own Signature in the Properties Bar per instance. In other words(Set each Circle a unique value of their instance variable named Signature.)

Third, put this event in the eventsheet...

Pick by comparison (If Circle.Signature = 1) then
----> Audio Play ClickSound1
Pick by comparison (If Circle.Signature = 2) then
----> Audio Play ClickSound2

etc.

OR YOU CAN USE IID OR UID AS SUBSTITUTE FOR THE INSTANCE VARIABLE (But this tends to be inconvenient especially when using IID for it tends to change when some instances are destroyed)

Pick by comparison (If Circle.IID = 0) then
----> Audio Play ClickSound1
Pick by comparison (If Circle.IID = 1) then
----> Audio Play ClickSound2
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,862

Post » Mon Dec 28, 2015 4:44 am

hey thanks @chadorireborn!...
Im gonna test it on my project
B
6
S
1
Posts: 43
Reputation: 492


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests