I am trying to make a drum shaped object do the following:
rotate left for 5 seconds
pause for 5 seconds
rotate right for 5 seconds
I built the following script and it works with one major problem. At the point the rotation stops, the prim rotates back to its root position.
integer direction = 1;
integer turning = 0;
default
{
state_entry()
{
llSetTimerEvent(5.0);
}
timer()
{
if (turning == 0) {
if (direction == -1) {
direction = 1;
} else {
direction = -1;
}
turning = 1;
} else {
turning = 0;
}
llTargetOmega(<direction,0,0>, 1*turning, 1);
}
}
So what you see is:
1- nice smooth rotation to the left
2-jerky quick jump rotation to the right and stop
3- nice smooth rotation to the right
4-jerky quick jump rotation to the left and stop
I am guessing there's a call I can use to make the prim stop at it's current position and pause then resume rotating in the opposite direction from the point it paused at.
What am I doing wrong?
Thanks in advance for your help,
Troy