Is it possible to have a command last only while the object is moving?

94 views Asked by At

I want an object to preform a task only while it is in motion, how do I do this.

1

There are 1 answers

0
Scott Rossi On BEST ANSWER

The answer to this depends on how you move the object. If you use the built-in move command to move an object, the movingControls function will return a list all objects that are in motion. If you use your own repeat loop to move an object, you'll need to continually test the moved object's position while the repeat loop is running. In both cases, you'll need to set up some kind of state to determine when to test object locations, so you're not always testing unnecessarily.