playMaker

Author Topic: MOUSE DOWN/UP with 2D collider[SOLVED]  (Read 12174 times)

brainchest

  • Playmaker Newbie
  • *
  • Posts: 3
MOUSE DOWN/UP with 2D collider[SOLVED]
« on: December 24, 2013, 08:18:45 AM »
Hi All,

I'm using the Unity 2D tools and (besides PlayMaker of course) added the PlayMaker Unity 2D package. Now I have a Sprite (a Toolkit 2D sprite) with a Circle Collider 2D. PlayMaker now reports errors for the MOUSE DOWN/UP event: "Owner needs a Collider or GUI Element to respond to mouse events". It seems to work (works for about 50% when I click the sprite) but I can't build the project in Unity because of those two errors. So it seems that the Collider 2D is not detected correctly.

Or do I miss something here?

Regards,
Stephan
« Last Edit: January 23, 2014, 07:17:50 AM by jeanfabre »

brainchest

  • Playmaker Newbie
  • *
  • Posts: 3
Re: MOUSE DOWN/UP with 2D collider
« Reply #1 on: December 25, 2013, 07:45:23 AM »
Just found the "Mouse Pick 2d Event" Action in the Input category which does exactly what I need. Seems like I don't understand the Events (like MOUSE DOWN/UP) from the Events view yet when I can fire all required events from the given actions.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: MOUSE DOWN/UP with 2D collider
« Reply #2 on: December 26, 2013, 02:41:14 AM »
Hi,

 MOUSE DOWN and MOUSE UP are working fine for me on a regular sprite 2d and a circle collider 2d. Can you try without 2dtoolkit?

 Bye,

 Jean

appymedia

  • Playmaker Newbie
  • *
  • Posts: 2
Re: MOUSE DOWN/UP with 2D collider
« Reply #3 on: January 03, 2014, 05:36:35 AM »
Hi,

Just thought I'd chime in and say I have the same issue an am using 2D Toolkit with Playmaker both updated to latest versions, any advice at all?  I did notice if I add a 3D collider theres no errors but as far as I'm aware I'm setup for 2D Physics etc.

I have a web based C# background but am fairly new to Unity and Playmaker and am looking forward to a quick workflow but be gentle please :)

Thanks

Pete

appymedia

  • Playmaker Newbie
  • *
  • Posts: 2
Re: MOUSE DOWN/UP with 2D collider
« Reply #4 on: January 05, 2014, 06:07:54 PM »
Hi,

Just thought I'd update and say I've since imported the 'PlayMakerUnity2D.unitypackage' and have added a 'PlayMaker Unity 2D' game object to my scene and the 2D Proxy script to my 2D Toolkit sprite (which also has a Box 2D Collider component attached).  I use the 'Mouse Pick 2d Event' to detect a mouse click on my sprite which seems to work fine.

My question is this the correct way to go about things?  Also, what is the difference between the system event 'MOUSE DOWN' and using the 'Mouse Pick 2d Event' action and the Mouse Down option?  Are there any docs for all the system events?  Sorry if some of my questions are a little stupid, still coming up to speed with both Unity + Playmaker :)

Awesome product by the way, will be using this a LOT.

Thanks All

Pete

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: MOUSE DOWN/UP with 2D collider
« Reply #5 on: January 06, 2014, 09:09:37 AM »
Hi,

 Yes, it's correct.

 "MOUSE DOWN" is a built in Unity call that is forwarded to you within PlayMaker for convenience as a global event.

"Mouse Pick 2d Event" is more versatile because you can set layer masks to filter picking.

Bye,

 Jean

 

Alatriste

  • Full Member
  • ***
  • Posts: 195
Re: MOUSE DOWN/UP with 2D collider
« Reply #6 on: January 07, 2014, 06:53:23 AM »
Hi,

Same problem here. After reading the thread I assume the best way to go here is adding the action "Mouse Pick 2d Event", right? I hope it can be fixed in an update as it is a bit confusing.

Thanks for the answers!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: MOUSE DOWN/UP with 2D collider
« Reply #7 on: January 10, 2014, 06:56:59 AM »
Hi

 There is nothing to fix here actually, it's by design. "MOUSE DOWN" global event is the direct Unity call, while "Mouse Pick 2d Event" action wraps mouse inputs and adds some features to make it more convenient.

what do you find confusing? It's important that these concept are totally digested, so don't hesitate, I am willing to explain or word differently, I can do a scene to show how it works as well if that could help.


bye,

 Jean

Alatriste

  • Full Member
  • ***
  • Posts: 195
Re: MOUSE DOWN/UP with 2D collider
« Reply #8 on: January 23, 2014, 05:40:50 AM »
Hi Jean,

Thanks for the explanation. I thought it was a bug because I got a warning message about using that event. (I think in the 2D mode of Unity 4.3, I cannot remember right now.)