Drag and drop states

Jan 28, 2020

Hi! I'm doing a drag & drop game (using freeform) and I need to allow only one object in a drop target, which has different states only while dropped on a specific target.

Let's imagine we've got two objects and one target. Putting the item on the target changes its state to "incorrect". Problem starts when I drop a second object, on the same, incorrect, target. Then the first item goes to its initial position (as it should) but with the same, "incorrect" state. I need it to be in a normal state, the moment it reaches its start point. I've made lots of different triggers for example: change state to normal when the objects intersection ends/when the object intersects (then I added a hotspot/triangle in my items initial position)/when the object is dragged over etc. None of them works. Do you have any other ideas how to solve my problem?

(My "Drag & Drop Options" are as follows: return item to start point if dropped outside any drop target; snap dropped items to drop target's center; allow only one item in each drop target (the obvious one); delay item drop states until interaction is submitted.)

 

3 Replies
Walt Hamilton

A couple of thoughts. If you have it set to delay drop states, then nothing will change until the submit button is clicked.

Adding your own change state triggers will probably conflict with the built-in triggers.

Try deselecting "Delay item drop states" and disabling your triggers, and see if it works.

If not, then there is something else affecting it, and you need to attach yout .story file here, so someone can see what it is.

Dominika Skrzeczkowska

Thanks for your reply!

Maybe I haven't made myself clear enough. According to your advice, I've made a very short example of what I want to achive.

In my .story file you can see 3 different layers. Program randomly choose one of them and basicly the layer indicates which answer should be correct (in my project I have my own randomize function with more different layers, here I've just used a random number and that can cause some issues, but that's not the point). Please check what happens when you want to replace the answers while the first one or both are incorrect. The state of those answers become "Drop incorrect" and I want to get rid of this.

If I deselect "Delay item drop states", in that particular case, it starts to work properly. But when I want to move the incorrect answer by my own, to its start point, then it works in the same, unproper way, as with this option selected.

And, just to remind, I want the answers to go back to its normal state everytime they're not dropped on the target. Triggers that are disactive, are those which functionality I've checked - with poor results.

Of course I can just make my own drag&drop, without using freeform, but I have lots of different anwsers in my project (not just 2 as in that example). They overlap each other and if I want to make a start point for each of them and make sure it'll always go back to its own base - it would get really messy.

So my question is - is there any way to make sure the answer go back to its normal state while being replaced by another answer? Or maybe I should do something else to achive the result I expect?

Thank you in advance!

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