Author Topic: How to Enable Box Collider when CloneOnDrag in UIDragDropItem is checked?  (Read 4628 times)

tofanwi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
i want to drop the clone object to grid, but the clone object can't drop to UIDragDropContainer, in my opinion the clone object can't drop to UIDragDropContainer because the box collider is false, why? how to fix it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
When an object is dragged its collider should be turned off so that it doesn't eat up events intended for whatever you're dropping it on.

Not sure what you mean by "box collider is false".

tofanwi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
i mean box collider is turn off when the clone object is dragged, how to enable the box collider of clone object so that the clone object can eat up events intended for whatever you're dropping it on, how?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
What? If you enable the collider of the dragged object, then it will steal all the events. There will be no "drop" event going to anything underneath, because you will end up dropping the object onto itself.

tofanwi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
my problem is solved with my self hahahaha, i can drop the clone object into dragdropcontainer, the cone object is drop into grid, and i want to make the container of grid is limited, i just want 6 object in grid, how to do that?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Validate your drop operation in OnDragDropRelease().