playMaker

Author Topic: 2D Trigger not triggering.  (Read 1642 times)

krane

  • Junior Playmaker
  • **
  • Posts: 63
2D Trigger not triggering.
« on: February 24, 2017, 11:08:40 AM »
Looking a the drag and drop demo package, I'm wondering if there is a way to say that a dragged object (any dragged object) is on top of a dropped target?

So, what I want to say is, "there is an object on me" on a dropped target.

I can't seem to get the 2d Trigger to work.
« Last Edit: February 24, 2017, 03:53:05 PM by krane »

krane

  • Junior Playmaker
  • **
  • Posts: 63
Re: 2D Trigger not triggering.
« Reply #1 on: February 26, 2017, 09:56:26 PM »
bump? (sorry)...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2D Trigger not triggering.
« Reply #2 on: February 27, 2017, 01:17:02 AM »
Hi,

Click on "edit" in your colliders, you'll see that they do not match the size of the image or UI elements.

 It's a bad idea to mix 2d colliders and UI elements, they are not supposed to work together, prefer using just the pointer events ( using a pointer component proxy) and then check when pointer enters if a dragging is occuring, something like that.

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2D Trigger not triggering.
« Reply #3 on: March 16, 2017, 06:53:49 AM »
Hi,

  I found the way to do that in a reliable way, with a simple drag and drop component:

 https://twitter.com/JeanAtPlayMaker/status/842327318441910273

It's available in the uGui full proxy on the Ecosystem, the component is called "BoxCollider2dMatchRectTransform"


Bye,

 Jean