Forum Discussion
Drag and Drop With Feedback Layers BUT NOT Correct or Incorrect
- 22 days ago
Although ThierryEMMANUEL has figured out a solution, I would still like to try a simpler version without using a tons of triggers.
I use the built‑in drag‑and‑drop function so that objects can return to the start area when a target is occupied. I also prefer using "state" for counting the TotalPlaced value and rely on two triggers to change the state.
What the built‑in model cannot change is that when another item is dropped on the same target, the original item still remains in the "placed" state even after returning to its initial position. Since this is the only issue in my solution, I thought—why not use the new AI assistant to solve the problem? Below is the prompt I gave the AI assistant, and it worked as expected. A single JavaScript snippet solved it.
Change the state of crit# to normal when they moves onto hotspot1 area. For example, change crit9 to normal when it moves onto hotspot1.
Here is my version3. As Nedim said, I also value discussions like this and gracful learn something from each other. Thank you!
Hi ELOUPEI,
You can use states to identify whether an object is dropped. If the object isn’t normal, then add 1 to TotalPlaced; if the state is normal, subtract 1 from TotalPlaced. I also added a new variable called ActivityBegin to prevent subtracting a value from TotalPlaced, since the object states are normal at the very beginning. So other than the first trigger below, for each drag item, you will need two triggers for counting:
- Set ActivityBegin to True when TotalPlaced changes.
- Add 1 to TotalPlaced when the state of crit# isn’t normal.
- Subtract 1 from TotalPlaced when the state of crit# is normal, if the ActivityBegin value is true.
However, if users drag the crit# out of the drop zone, its state won’t return to normal and the counting will be incorrect. So each crit# should have a trigger to return its state to normal to ensure the counting is correct.
- Change the state to normal when crit# stops intersecting with the hotspot (table area).
Unfortunately, JoanneChen , I've run into another problem. If I move the proposals WITHOUT taking them out of the starting area (I know, it's stupid), the variable increases to possibly 9. And I can't bring the variable back down.
- ELOUPEI27 days agoCommunity Member
Yeah, it doesn't seem to be following the triggers of subtracting one from the count or setting the state of the criteria back to normal. And here's a video showing some of the other things that are happening with the count when you try adding and removing various criteria. The "argument/purpose" criteria is acting the weirdest of them all.
https://360.articulate.com/review/content/62098877-4d92-421d-ad04-494ef090f311/review
Related Content
- 4 months ago