Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

OnDrag without holding mouse click

Discussion in 'Scripting' started by patrick750, Mar 30, 2020.

  1. patrick750

    patrick750

    Joined:
    Nov 29, 2019
    Posts:
    12
    I'm implementing an Action Bar system where the user can drag any ability into any other slot.
    If the user moves the ability to an empty slot, I have that working fine.
    If the user moves the ability to an occupied slot, right now I have the choice of making it take over the data from the occupied slot or swapping the data. Neither of these solutions seem good enough for me.

    I would like for the occupied slot to be picked back up so that I can move it to a new slot. This seems like the most user-friendly solution (and lots of MMOs do this).

    I'm currently using OnBeginDrag, OnDrag and OnEndDrag functionality to do what I need. Ideally I'd like the occupied ability to be the 'eventData' of 'OnDrag' when i let go of my left mouse button but I can't find a way to do this (aka call the Event while not actually having mouse button held).

    Any ideas?
     
  2. patrick750

    patrick750

    Joined:
    Nov 29, 2019
    Posts:
    12
    Still struggling to find a solution if anyone has input.