Search Unity

Question Drag and drop small 2d sprites

Discussion in '2D' started by TLummen, May 29, 2023.

  1. TLummen

    TLummen

    Joined:
    Jan 15, 2019
    Posts:
    15
    I have a question for unity pros If someone has the time to give me some one on one ... I have sprites in a 2d enviorment and some are small and hard to click and drag... How can I make an Invisable handle for drag and drop.. I can provide more context and associated scripts.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Depends on how you click on it.

    If you use colliders, make a secondary collider, use layers to make it not collide with anything, and make your click test those colliders as well.

    Otherwise if you do the coordinate math yourself, just make the distance requirement larger.
     
  3. SeerSucker69

    SeerSucker69

    Joined:
    Mar 6, 2021
    Posts:
    68
    We've all seen some developers solve this by scaling up the sprite size when you hover over it, makes it easier to see and also easier to select (and see what you are currently hovering over)