Search Unity

Need small help in Unity - Dragged object getting masked due to UI mask.

Discussion in 'Scripting' started by heyramb89, May 24, 2019.

  1. heyramb89

    heyramb89

    Joined:
    Dec 29, 2018
    Posts:
    29
    Hey,

    I need a little help in Unity.
    I have inventory done but when I drag object because of UI mask object is also getting masked and it is not appearing out of inventory.
    Please check the screenshot.
    Perhaps, it could be a small thing but I don't know much about coding.
    I want my object to appear out of inventory also.
    I have also attached script.
    Any help would be appreciated.
    Thanks...
     

    Attached Files:

    • 001.png
      001.png
      File size:
      143.5 KB
      Views:
      525
  2. Ether141

    Ether141

    Joined:
    Jul 30, 2018
    Posts:
    21
    On begin drag, throw icon out from mask to other game object and on end drag, throw it back to mask.

     
    heyramb89 likes this.
  3. heyramb89

    heyramb89

    Joined:
    Dec 29, 2018
    Posts:
    29
    So, if I have 20 slots, does that mean I have to make 20 icon holders with icon?
     
  4. Ether141

    Ether141

    Joined:
    Jul 30, 2018
    Posts:
    21
    No, you don't have to. One holder is enough. You can't drag many icons in the same time. On begin drag, set dragged icon's parent to IconHolder, and on end drag, set his parent back to slot. I hope you know what I mean.
     
    heyramb89 likes this.
  5. heyramb89

    heyramb89

    Joined:
    Dec 29, 2018
    Posts:
    29