Forum Discussion
How do I get drag and drop incorrect to snap pack?
Hey everyone,
I’m creating a drag-and-drop interaction in Storyline. I want the drag objects to snap back to their original positions when they are dropped on an incorrect drop target.
I’ve followed several tutorials, but unfortunately, none of the methods have worked for me. Perhaps that’s because the tutorials are about six years old.
I’ve attached my Storyline file to this post and would really appreciate it if someone could show me how to set this up correctly.
Thank you so much!
Hello - For this, I would use a 0px motion path animation. See attached.
First, I duplicated your incorrect layer and called it Try Again and for question design, I updated attempts to unlimited (it was set to 1, so the user technically couldn't try again). You'll want to update the incorrect layer to be whatever your final incorrect feedback is.
Then, I selected each drag object, and then > animation > add motion path > line > moved the red dot/motion path end point to the center of the object (to make it 0px).
This creates a trigger. I copied each trigger and pasted them onto the Try Again layer (to trigger when the layer timeline starts). Then I deleted the original triggers from the base layer.
I hope that helps.
8 Replies
I have a follow up question. How can I show the incorrect and try again content in those layers from the base layer? I turned off hide layer and hid the background color file but I still couldn't see the baser layer. Thank you!
- AshleyChiassonCommunity Member
Hahaha. Judy! We responded at the same time (with slightly different approaches) :D
- JudyNolletLegend
I saw that! Basically the same approach: resetting with a 0-length motion path. I didn't bother with renaming the layer, but that is why I linked to my post about multiple attempts.
- AshleyChiassonCommunity Member
Hello - For this, I would use a 0px motion path animation. See attached.
First, I duplicated your incorrect layer and called it Try Again and for question design, I updated attempts to unlimited (it was set to 1, so the user technically couldn't try again). You'll want to update the incorrect layer to be whatever your final incorrect feedback is.
Then, I selected each drag object, and then > animation > add motion path > line > moved the red dot/motion path end point to the center of the object (to make it 0px).
This creates a trigger. I copied each trigger and pasted them onto the Try Again layer (to trigger when the layer timeline starts). Then I deleted the original triggers from the base layer.
I hope that helps.I would like to thank everyone for their response! You were a big help!
AshleyChiasson your file worked. However, I do have a couple of questions.
- Do I need both an Incorrect layer and a Try Again layer to work correctly? When I removed the Incorrect layer and kept only the Try Again layer, I was unable to try again.
- How did you add a custom Try Again layer within the forums window?
EDIT: I see that a customer Try Again Form View layer was automatically included when I changed the Attempts to unlimited.
Thank you!
- AshleyChiassonCommunity Member
Yes - And when I did it, I just changed the attempts, deleted the generated Try Again layer, duplicated the Incorrect (since you already had it set up the way you would want the Try Again layer), and renamed it "Try Again" :D - I did it from slide view (not form view).
- JudyNolletLegend
Storyline doesn't automatically reset question response (including drag items) when the user gets to Try Again. So you need triggers to do that for you.
To return a dragged item to its starting position, give it a Line Motion Path with "0" length.
Note: When you add a Motion Path, Storyline automatically adds a trigger to move the item on the path when the timeline starts. Delete that trigger!
Instead, add a trigger on the Incorrect layer to move each dragged item on its 0-length motion path. That will put it back in its starting position.
In the attached file, I added the motion path and trigger needed for Label 1. You need to do the same for Label 2.
FYI: There is some built-in functionality to give the user more than 1 attempt to answer a question. This post explains the Try Again feature, including how to reset responses.
Thank you for your help JudyNollet
Related Content
- 10 months ago