Forum Discussion

ChristopherC570's avatar
ChristopherC570
Community Member
25 days ago

Drag and Drop whilst changing states

Hi everyone, I’m hoping someone can help!

I’m trying to coordinate a drag-and-drop interaction so that items change state when dropped on specific hotspots. All the triggers and targets seem to be set up correctly, but it’s just not working as expected—and it’s really starting to frustrate me! I've attached the file so you can see for yourself.

For context, the items should go as follows:

  • Broccoli → Chiller
  • Bad Apple → Bin
  • Strawberries → Chiller
  • Banana → Bin
  • Mushrooms → Chiller
  • Bad Orange → Bin
  • Pineapple → Ambient

Any advice would be hugely appreciated. Thanks in advance!

2 Replies

  • Hi Christopher!

    I get the frustration when things don't work as you trigger them. So many things to check. Here's what I tried: 

    Omitted (hid) the hotspots and just had fruit drag over the chiller, ambient, and bin images themselves.

    Sent the chiller, ambient, and bin images to back, as the fruit wasn't working right.

    It seems to work, but see what you think with attached. It may need more finessing.

    Hope this helps!

  • ChristopherC570​ : I was looking at the file, but got pulled away. I see that CydWalker_mwhc​ answered in the meantime. 

    Like her, I didn't use the hotspots. There's no need to add those extra elements. 

    I also moved the ambient shelves and the chiller behind the all the fruit. I left the bin in front, so the bad fruit looks like it's in the bin. 

    Other issues I spotted: 

    The target images had a LOT of extra space around them: 

    That makes them overlap, which can impact what the program sees as the drop target. So I cropped those. 

    I'll also note that a couple of your triggers used the wrong hotspots. For example, the Bad Apple was set to change when dragged over Hotspot 3. But that was the hotspot over the chiller. (That's a great example of why it's helpful to give every object involved in an interaction a meaningful name.)

    BTW, the bad bananas appear above the bin, even though they're in the bin in that state. Not sure why. I suggest you delete that item, and then recreate it.