Reset Variable Value to Blank When Dragged out of Target

Sep 19, 2022

Hello everyone,

I am working on a password drag and drop game using a freeform drag and drop interaction, and I have some questions. (Not sure why I can't see my discussion post so I decided to post it again)

Question: Is it possible to reset the password value to blank if the dragged items are dropped outside the drop target? I know that the dragged items will return to its starting point if dropped out of target.

However, I want to reset the value at the same time. For example, if a player drag "1234" to the target place, but he regrets and wants to put it back and drags another password "4567", can we reset the value from "1234" to "blank" so we can turn it into a new value?

Thanks for your help, I've attached an example, so you can see what I'm talking about. As you can see from the example, even though I returned the password Summer to its starting point, the password value is still Summer, instead of blank.

Thank you so much.

3 Replies
Walt Hamilton

You ask:

can we reset the value from "1234" to "blank" so we can turn it into a new value? 

If the value of password is “1234”, and you set it to “5678”, “5678” will replace “1234”, without you having to set it to blank in the middle.

If that doesn’t work for you, one option is to place an invisible target under the drop target that is bigger than the drop shape. Then trigger the variable to set to blank when the object is dragged over the invisible target.

The invisible object must be filled and set to a transparency between 95 and 99%.

Yen Cheng

Hello Walt,

Thank you so much for your reply. It's really helpful!

Yes so for now I am using the first method you have brought up and it works well.

I also tried the invisible drop target method but if I dropped the item on the invisible drop target, the item won't be able to return to its original position. Instead, it will jump to the center of the invisible target and that will overlap with other items on the interface.

Thank you so much :)