07-02-2006 18:20
I have made a pair of fangs (using Torus prim) which I want to rotate in and out of my mouth. My script is:
integer Extended = 1;


default {


state_entry() {
llListen(0, "", llGetOwner(), "fangs";);
}


listen(integer Channel, string AvName, key AvKey, string Message) {
if (Extended) {
llSetRot(
llEuler2Rot(<0, 0, 0> * DEG_TO_RAD)
);
Extended = FALSE;
llWhisper(0, "Retracted";);
} else {
llSetRot(
llEuler2Rot(<0, 00, 90> * DEG_TO_RAD)
);
Extended = TRUE;
llWhisper(0, "Extended";);
}
}



}

The problem is that even if I position them properly to start, on the first activation, they rotate 90deg *sideways* and then rotate around the vertical axis from then on out.
How do I get them to rotate around the horizontal axis or set an initial orientation for the object.