1) even though I put in lots of positions, the swing reverts to far fewer when it is running in the world (oddly it runs the way it is supposed to when the edit window is open). I read somewhere here that's a well known bug, but I have seen smoother swing/rocker scripts. Does anyone know of a smoother script, or how to fis this one so it is smoother?
2) the way the script is now, it will always face only one direction when it swings. So if I place it N/S and click it to swing, it will turn to face E/W. The only way to change that is to alter the vector normal in the code and recompile. This is kind of a pain, especially for people who aren't comfortable with LSL.
Can anyone see an easy way of changing the code so that the swing will swing whatever direction you set it out, without having to change the vector normal in the code? Is there a "get orientation" LSL command or something?
THANKS!!!!!!
CODE
rotation Inverse(rotation r)
{
r.x = -r.x;
r.y = -r.y;
r.z = -r.z;
return r;
}
rotation GetParentRot()
{
return Inverse(llGetLocalRot())*llGetRot();
}
SetLocalRot(rotation x)
{
llSetRot(x*Inverse(GetParentRot()));
}
vector normal = <1.5, 0.0, -1.75>;
default
{
state_entry()
{
@a;
SetLocalRot(llEuler2Rot(<normal.x, normal.y, normal.z + 1>));
SetLocalRot(llEuler2Rot(normal));
SetLocalRot(llEuler2Rot(<normal.x, normal.y, normal.z - 1>));
SetLocalRot(llEuler2Rot(normal));
jump a;
}
}