Help! Trying to add a "pause" action to moving object


I have a time marker that starts to move as I press a “Run” button. But I couldn’t figure out a way to make the “Pause” button stop it and show it at its last location.

Here is a link to what I have right now (press “run” and wait, it takes some time to start…)

Link to rp file (version 8)

:confused: Hopefully there’s a simple answer I am overlooking, its been driving me crazy for days now :frowning:

Thanks in advance for any help,

Basically you’ll have to have some sort of loop that triggers each step of the animation in sequence. Your steps should be equal to the level of detail you want to be able to pause at. In yours I see as the line reaches the end of a segment, the green area shifts. If you wanted to be able to pause at the end of a given green area, that will be the step you iterate over in your loop. You’ll then need a variable to track whether the user has it set to run or pause, and at the start of each step check that variable to determine if the animation should continue or not.

Thanks Nathan - Assuming I got the part about setting the variable that checks if the run is paused or not, how do I tell the loop to stop if the variable value is “IsPaused = Yes”?
I added to the hidden shape that triggers the loop a condition to check a variable called IsPaused, but I am not sure how to set the alternate condition, for when the IsPaused value is “Yes” (where it should pause). See screenshot for that:

Thanks again for your help!

Unable to view v8 Beta files for the moment, but based on your image it looks as if you’ve got the right idea. Just for troubleshooting’s sake, you might try moving the “Show animationTrigger” action to OnHide event, as sometimes when you have actions that trigger near simultaneously there can be strange behaviors.

Thanks again Nathan - I solved the problem and will document it here for the benefit of future peers who run into this issue:
[li]The first problem was that I have set an animation for the move action of the marker - it caused the entire mockup to behave strange and start with delay. Once I removed the animation and added a “Wait” action it ran smoothly and with no delay[/li][li]In order to make both the initial “Run” button make the marker progress and also the “Resume” button do the same I had to place the interaction for the trigger on both “OnShow” and “OnHide”. Not sure if this is the most elegant way, but it works :)[/li][/ol]

This is how the iteractions for the AnimationTrigger Looks now that it’s working:

start pause animation Vr02.rp (184 KB)

This is brilliant! Thanks for posting the solution and the RP file. 2 years later, it has helped me solve a vexing problem. Thanks!

1 Like