Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: TerryGM on February 13, 2017, 09:12:48 AM

Title: HELP: how do i stop all sounds from playing when I click a gameObject
Post by: TerryGM on February 13, 2017, 09:12:48 AM
Hi all,

I have a simulation with several speech bubbles are slowly spinning over various game objects. You click the speech bubble it spins a bit faster and is supposed to play a brief description of the object.

But what is happening it is playing ALL the sounds from each speech bubble at the same time, also all the speech bubbles are reacting to the one click as though they are all  being clicked once as well. I am a bit lost in how to fix this.

Any help would be greatly appreciated.

-Teg
Title: Re: HELP: how do i stop all sounds from playing when I click a gameObject
Post by: Fat Pug Studio on February 14, 2017, 12:45:52 AM
How did you impement it? Via on click?
Title: Re: HELP: how do i stop all sounds from playing when I click a gameObject
Post by: TerryGM on February 14, 2017, 06:07:16 AM
Hi Krmko,

I used on MOUSEDOWN.
Title: Re: HELP: how do i stop all sounds from playing when I click a gameObject
Post by: Fat Pug Studio on February 14, 2017, 07:06:34 AM
as far as i know, mousedown activates scripts on scripts attached to the gameobject that is clicked on. Are their colliders overlapping? Are they all on the same GUIElement?

Do you have a screenshot of the FSM so we can see where's the problem?
Title: Re: HELP: how do i stop all sounds from playing when I click a gameObject
Post by: marv on February 14, 2017, 09:02:24 AM
If you used the general "Get Mouse Button Down" action that's not tied to any UGui components, then this just listens for the mouse button in general, not in a specific location. This would explain all of them getting triggered at once.

In that case I'd use either the UGui Pointer event component or the UGui component proxy depending on what other functionalities you need.

As krmko said, a screenshot would help, without more information it's hard to pinpoint the problem... could be any number of things.
Title: Re: HELP: how do i stop all sounds from playing when I click a gameObject
Post by: TerryGM on February 14, 2017, 09:49:47 PM
The image is attached, let me know if you need any other info. And thank you both for replying
Title: Re: HELP: how do i stop all sounds from playing when I click a gameObject
Post by: marv on February 15, 2017, 06:20:15 AM
Yeap, as I said. The "Get Mouse Button Down" action doesn't care where your mouse pointer is at the time of the button getting pressed. Think of it more as a hotkey thing. Whenever you press they key everything listening for it will be triggered at once.

If you don't have it already, get the playmaker UGui package from the ecosystem. Depending on how you've set up your gameobjects you'll probably want to use either the pointer event proxy or the component proxy for this.

cheers