I have a welded object on my map that I want to rotate in a random direction horizontally every 4 seconds or so (that is, at one moment it is rotating left, the other it is rotating right.)
To that end I have a script brain that, every 4 seconds, sets a global alpha variable randomly between -10 and 10. On the object I want to rotate, I have two scripts:
1. It checks the global variable. If it's smaller than or equal to 0, it rotates 180 degrees in the x axis in about 4 seconds.
2. It checks the global variable. If it's larger than 0, it rotates -180 degrees in the x axis in about 4 seconds.
Each script also changes the colour of the object.
However, the object is seemingly ignoring the second script no matter how I set the timing. Each script is set to look at global variables, and the directions are not the same, yet the object will only ever turn 180 degrees and will stay the same colour.
Here are images of the scripting:
Script Brain
Script 1
Script 2
Map File
What am I doing wrong here? Is the timing off?