SL3: Motion Paths Back and Forth on button press

Hello, I have an object and a button on a slide. When the button is pressed the object moves to the left. Then, when the button is moved the object moves to the right back to the beginning. 

I know how to set this up using two motion paths with a variable and relative starting points. I need to be able to have the object start going the other direction in the middle of its path. For example, click the button to send the object to the left but interrupt it and click again to move the object directly to the right, from the middle of the first motion path.

 

Is this possible?

2 Replies
jack hughes

I dont think this is possible by the normal setup of motion paths (anyone feel free to correct me on that one) 
But one way you could possibly simulate that is having two smaller motion paths and linking them to a variable so something along the lines of:

1. move 'left' when 'left' completes if Var <10
1b. +1 to Var when 'left' completes
2. move 'right' when 'right' completes if Var >0
2b. -1 to Var when 'left' completes
3. move 'right' when uses clicks box (and box=true and Var >0)
4. move 'left' when uses clicks left(and box=false and Var >10)

Tyler Bernardy

Thank you Jack! I tried this, and had an issue with the box slowly drifting if you clicked fast enough. After I played some more I came up with a simpler solution by using your suggestion of two smaller motion paths. For your (and anyone's) reference, here's what I did:

I set up two boxes on both ends of the path, which will be hidden behind a white box in the final version. Created two T/F variables one for each box, when the moving object intersects it sets that variable to true. Both variables are set to false anytime the button is pressed. The smaller motion path will restart unless the end variable is set to true.

Please see the attached example. Thanks for your suggestion!