- Home /
idrophandler and on drop function
hello
i have two ui button . i write a arag script for them and i want to find out where they droped !
if 56 droped on 68 then do somthing !
how can i do that ?
tnx
You have to clarify what your question is. Surely you're not asking someone to write behaviour for you from scratch?
not clear ? really ?
i don't know what is the solution for this problem and how can i solve it !
its a tricky problem and i need a way to solve it , a tip from a experienced guy . not the whole script ! ;)
Alright, the tip is to use the OnDrag and OnDrop Event Triggers on objects that have either a physics or a graphic raycaster component/attribute enabled. Those functions trigger when something with those components or attributes are dragged and dropped on an object with either raycasters. To get the location of where they dropped you simply need to get the transform.position of the object you're dragging in the OnDrop function.
Here is the documentation you should read: https://docs.unity3d.com/ScriptReference/EventSystems.EventTrigger.html
Your answer
Follow this Question
Related Questions
UI drag and drop 1 Answer
UI Button Event Trigger Update Selected not working 0 Answers
UI Button Set Image 1 Answer
UI Button ON/Off 3 Answers
UI Button and character actions 1 Answer