playMaker

Author Topic: HELP: how do i stop all sounds from playing when I click a gameObject  (Read 1224 times)

TerryGM

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
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
« Last Edit: February 13, 2017, 05:53:33 PM by TerryGM »

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 987
    • View Profile
    • Fat Pug Studio
Re: HELP: how do i stop all sounds from playing when I click a gameObject
« Reply #1 on: February 13, 2017, 10:45:52 PM »
How did you impement it? Via on click?

TerryGM

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: HELP: how do i stop all sounds from playing when I click a gameObject
« Reply #2 on: February 14, 2017, 04:07:16 AM »
Hi Krmko,

I used on MOUSEDOWN.

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 987
    • View Profile
    • Fat Pug Studio
Re: HELP: how do i stop all sounds from playing when I click a gameObject
« Reply #3 on: February 14, 2017, 05: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?

marv

  • Junior Playmaker
  • **
  • Posts: 50
    • View Profile
Re: HELP: how do i stop all sounds from playing when I click a gameObject
« Reply #4 on: February 14, 2017, 07: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.

TerryGM

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: HELP: how do i stop all sounds from playing when I click a gameObject
« Reply #5 on: February 14, 2017, 07:49:47 PM »
The image is attached, let me know if you need any other info. And thank you both for replying

marv

  • Junior Playmaker
  • **
  • Posts: 50
    • View Profile
Re: HELP: how do i stop all sounds from playing when I click a gameObject
« Reply #6 on: February 15, 2017, 04: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