Quote:
Originally Posted by x2495iiii
What I'd do is delete all of your boolean variables, then make one number variable called speed under the properties tab of the world (NOT in the method). Then, have the off button set speed to 0 when clicked, the low button set it to one, and so on for the other two buttons. Then, make a new "while the world is running" event which calls one of the methods in the During part of it (which basically means the event wil be called over and over while the world is playing). Finally, have the method that is called in the During part of the event contain a nested if/else if method which looks like this:
if speed == 3
fan.blades roll left .1 revolutions [duration = 0 seconds] [style = abruptly]
else
if speed == 2
etc.
I tried this myself, and it works wonderfully.
|
There's an even easier way.
Create a global variable and give it a starting value of 0
Create events to assign different values to the variable per button.
In 'main', write a single line of code..
while true
fan.blades->roll at speed [global variable] per second
When the event's are executed, the variable in the infinite while loop will have it's value substituted.