- Home /
Running Functions in Order
I have a function called Motion that controls a moving platform or obstacle. The problem is that when I call it, all the included functions occur at the same time. How can I make it so each function waits for the previous one to complete before activating? In addition, I also want to know how I can loop it as long as moving==True. I tried a While loop but it just made the functions occur on every frame.
function Motion(){
if (moving){
yield WaitForSeconds(startpause);
ForwardMove(forwardtime);
yield WaitForSeconds(endpause);
BackwardMove(backwardtime);
yield;
}
}
Comment
Your answer
Follow this Question
Related Questions
Best way to make these tree iterations? Arrays? tags? nested etc 1 Answer
Calling functions in a specific order. 1 Answer
Why pass parameters into a function? 2 Answers
my foreach loop and condition wont work 0 Answers
while loop not looping 2 Answers