Drag and Drop with add/subtract values issue

Oct 21, 2019

Hi all,

I'm trying to create this drag and drop interaction where once the user drops the ball on the hotspot target, it adds an amount to the total (1 softball = 100). However, once I drag and drop the same ball on the same hotspot, it adds the value again to the total, so the value becomes 200.

Does anyone know how to prevent this double adding?

Many thanks,

Joanna.

1 Reply
Jerry Beaucaire

Since you want to be able to freely move the ball within the glass, that is causing the multiple hits of +100.  You'll need a limiter, so I'd suggest a variable you can control.

For the SOFTBALL :

  1. Create a true/false variable called Softball
  2. The triggers for the Softball image would then be this, in this exact order:
    • Add 100 to total softball is dropped on Hotspot 1 on the condition that variable Softball is False
    • Set Softball equal to True when softball is dropped on Hotspot 1
      (position this new trigger directly below the one above)
    • Subtract 100 from total when object intersection ends (softball > Hostpsot 1)
    • Set variable Softball  to False when object intersection ends (softball > Hotspot 1)

That should do it.  Repeat with the other balls.

 

This discussion is closed. You can start a new discussion or contact Articulate Support.