Stopping an Object's Motion Path

Jun 15, 2022

I have a cube set to move in a rightward motion path when a button is clicked and leftward when a different button is clicked.  The object is relative to the start point so it just continues going in one direction or the other depending on which button is clicked, and keeps going off the slide unless the opposite direction button is clicked.  What is an easy workaround to set boundaries for this type of thing so the object stops moving once it hits the edge of the slide? 

I tried using a true/false variable and a transparent object so that when the moving object intersected the transparent object, it would change the variable and stop moving on the path, but that didn't work.  Any creative ideas that would work?

2 Replies