-
Continuous linear movement that starts and stops on a checkbox
Hey all
I’ve got an object continuously move along one axis at a rate of 5px per frame.
What I’d like to do is set up a check box that when checked, starts and stops the movement. Keeping the object in the same position until it’s checked again.
So far any attempt I’ve had resets the objects position to 0 when checkbox is false;
var pos = 0;
var check = effect("Checkbox Control")("Checkbox");
var frames = timeToFrames(time,25)
var speed = 5;for (var i = 0; i < (frames); i++){
if (check == 1){
pos += speed;
}
}pos;
Any help would be awesome!
Thanks!