Here's the script:
CODE
float second;
default
{
state_entry()
{
llSetTimerEvent(3);
}
timer()
{
if (second < 1)
{
second = (llFrand(2));
llTargetOmega( < 0, 0, 1 >, (llFrand(-0.3)) * PI, .1 );
}
else
{
second = (llFrand(2));
llTargetOmega( < 0, 0, 1 >, (llFrand(0.3)) * PI, .1 );
}
}
}
You can all probably see at a glance that it just does a random, reversing z-axis rotate. It does exactly what I wanted.
The problem occurs with what I'm doing with it - attaching long, thin flexi parts to a tall cylinder. Sometimes it works great, with nice smooth movement. Other times, the flexi pieces look like they are having a seizure, with extremely jerky movements. It seems less with smaller flexi parts, but I wrote the script with large trees in mind.
I know the TargetOmega script is a client-side thing, which is probably where the problem lies, but I just couldn't get smooth movement using other rotation commands. (okay, I didn't really try that hard, but I'd really like to do it this way.) Is this something that can be "fixed" or worked around? Or is it a quirk of flexi, making my idea of pretty dancing trees a pipe dream?
Help would really be appreciated!
Edit: Sorry, didn't know the "php" thing for script windows. Should have read the sticky first!