Drag Drop - and live display?

Hi all,

I would like to make a drag-drop where the user can drag objects with unique money-values and time-values attached on them into and out of a box, so that each time the user drags one in, a counter will update to reflect the new money-values and time-values of all the individual objects inside that box, and each time they drag it out, the same counter will update with the new total numbers. Is this possible? 

So far, I've only been able to make the drag-drop update the counter whenever you drag an object inside. However, I can't make it update when you drag the object outside. Help please! Is there a good way to go about this? Thank you!

4 Replies
Phil Mayor

I would use the drag correct and drag incorrect states to evaluate where the object is at anyone time, set it to drag correct when dropped in the box, then set it to drop incorrect when outside the box, use triggers and conditions on the counter variable based on drop correct or drop incorrect

Bingjie Hu

Thanks for your suggestion Phil! That definitely helps with counting the new money and time values. 

However, an issue that I am now running into is that I have three total boxes that the user can potentially drag the objects into. Only one of those boxes is the counter. If the user drags the object from the counting box into one non-counting box, then the counter will update correctly. However, if the user drags the same object again into another non-counting box, then the counter updates again, though I don't want it to. Do you have any suggestions about this? 

Bingjie Hu

Hi Phil,

Now it looks like the state of the object isn't updating correctly - I've uploaded the file here. The draggable object is the yellow rectangle, and the boxes are the three hotspots underneath. The counters that should update each time are the black clock, and the money counter underneath it. Right now, the money counter is updating only when the object is dragged into the box on the left-side, and not updating when it's dragged out.. The timer is also counting upward no matter where it is dragged. It should only count up when the object is dragged into the correct box, and down when it is taken out.. Would you be able to take a look?

Thanks so much!