playMaker

Author Topic: "Send event" followed by "Mouse Pick Event"  (Read 1770 times)

2501

  • Playmaker Newbie
  • *
  • Posts: 14
"Send event" followed by "Mouse Pick Event"
« on: December 18, 2017, 12:12:35 PM »
Hi there!

So I have this state with a "send event" with broadcast all, exclude self and only once (no every frame), followed by a "mouse pick event" that says wait for mouse off or mouse down.

But the "mouse pick event" is ignored and runs through the "mouse off" event even if the mouse has not moved an inch. Or pixel. Or something really smallish.

Any ideas?


thanks in advance,
J.

Deek

  • Full Member
  • ***
  • Posts: 133
Re: "Send event" followed by "Mouse Pick Event"
« Reply #1 on: December 19, 2017, 02:21:38 PM »
The problem doesn't lie within the "Send Event" action (so you can ignore that one), but with how the "Mouse Pick Event" functions: It only checks where your mouse is currently at and sets that in relation to the specified GameObject.
If the raycast that gets shot from your current mouse position hits a collider/trigger on that GameObject, it fires the 'Mouse Over' Event, in any other case it fires 'Mouse Off' (the 'Mouse Down' and 'Mouse Up' events can also only fire when the mouse is currently over that GO).
It fires 'Mouse Off' whenever it can't detect the GameObject, which can be caused by several things:
  • the 'Ray Distance' is too small / the GameObject too far away (unlikely)
  • the targeted GameObject doesn't contain a collider or rigidbody
  • you need to specify the layer of the targeted GameObject in the 'Layer Mask'
So you should really only use the 'Mouse Off' event option when you are certain that the mouse is currently over the desired GameObject and want to detect if it moved away from it.

2501

  • Playmaker Newbie
  • *
  • Posts: 14
Re: "Send event" followed by "Mouse Pick Event"
« Reply #2 on: December 21, 2017, 02:35:38 PM »
Hey Deek

Thanks for the reply! I'll try different layers next. We're using it for mouse over and info-texts on objects in an adventure game and tried to use the Send Event as a workaround the problem with templates and hierarchy objects. It works on our small scale.

J.