Search Unity

Unity Sprite and IDropHandler

Discussion in '2D' started by Ichimitsu, May 22, 2015.

  1. Ichimitsu

    Ichimitsu

    Joined:
    Oct 9, 2014
    Posts:
    26
    Hi All ! :)

    I had a problem with the unity event system.
    I want to implement DragAndDrop for sprites.
    I use Physics2DRaycaster on MainCamera and implement interfaces for two object (Drag and Destination)

    Drag Object implement IBeginDragHandler, IDragHandler, IEndDragHandler
    Destination Object implement IDropHandler

    Dragging works correctly, but IDropHandler does not work. OnDrop method is not invoked the Destination Object.

    Please help me :), I will be grateful
     
  2. ColossalPaul

    ColossalPaul

    Unity Technologies

    Joined:
    May 1, 2013
    Posts:
    174
    Hi, the UI forum for be best for this.
     
  3. h0lyRS

    h0lyRS

    Joined:
    Mar 25, 2015
    Posts:
    3
    Hi @ColossalPaul
    One question though: does onDrop only work with UI elements?
    I'm having the same issue... I am not using UI elements, just 2D Sprites.