Forum Discussion
A few drag and drop queries
#1. Remember, this is a visual medium. Nothing has to do what you want it to, it only has to look like it is doing it. In this case, when the item is dropped, it disappears - therefore it can't be dragged again. The target changes to look like the item is dropped on it, so all is well. One way to do this is to create a state for the target that has the item dropped on it. When the item is dropped, change it to hidden, and change the state of the target to the "correct drop" state. This probably will mess up the regular submit and check process, so you may have to copy the Hidden state and name it "Drop Correct"
#2. Put a shape immediately behind the target. Make it filled (or it won't register actions), transparency set to 95% or greater (to make it invisible), and larger than the target (so it will register even if the learner drags it fast). Tie your interaction to the item being dragged over the shape. (Perform interaction when item is dragged over shape.) The action will also occur when the shape is dragged onto the target, so depending on what the action is, it might cause problems. If so, set it up so the action takes place only if the item has been dropped.
1. Create a variable named something like "ItemIsDropped". Make it T/F, with a default value of false
2. Change the trigger to "Perform action when item is dragged over shape, if ItemIsDropped = true"
3. Create a trigger "Adjust variable set ItemIsDropped to true when item is dropped on target"
4. Create a trigger "Adjust variable set ItemIsDropped to false when item is dropped outside of target"
#3. Create an invisible shape like in step two, but large enough to cover all the white space. Place it on the timeline below the drag items, drag targets, and the shape in step 2, if you are using them together. Place it so it is above everything the item can be dropped on outside the specific drop targets. Create a trigger "Perform interaction when item is dropped on shape."
In this case, you would use variables to tell SL if an object has been dropped on a specific target, which is something it wouldn't otherwise know. Use variables to tell the program what happened somewhere else, or that it can't normally know, like the following example.
Related Content
- 11 months ago
- 3 months ago