I have a object rotation script for a wet of wings, it moves 25 degrees and then to -25. I "flaps" a few times then stops. I'm goign to place the movement scrit here and I really hope some one can either instrusct me cause i feel liek an idiot, or point me in the right direction.
Thing's I'm trying to add
a chat command to start and stop it
make it "flap or wag" indefinatly untill the owner tells it to stop
a link from each wing to the root prim (hidden inside of the body) to keep them synced
// Zi's wag V1.0
//
// Description: makes your tail wag softly
// Installation: edit your tail, open "Content" and Drag & Drop it into the contents folder
// Licence: copy freely, charge nothing
// holds the tail position before starting the script
vector originalPosition;
// do the actual wagging
doWag()
{
integer amplitude=25; // maximum wagging width in degrees
integer numOfWags=4; // how many times to be wagged
float steps=15; // how many steps per wag, higher is slower
float moveBy=0; // current wagging position
// start wagging, count the steps
integer num=0;
while(num<
steps*numOfWags)){
// calculate new tail position
moveBy=llSin(num/(steps/2)*PI)*amplitude;
// rotate tail
llSetRot(llEuler2Rot(DEG_TO_RAD*(originalPosition+<0,moveBy,0>
));// next step
num++;
}
// set back to original position
llSetRot(llEuler2Rot(DEG_TO_RAD*(originalPosition)));
}
// program starts here
default
{
state_entry()
{
// remember tail position when not wagging
originalPosition=(RAD_TO_DEG*llRot2Euler(llGetLocalRot()));
// start first wagging almost immediately
llSetTimerEvent(1);
}
// every ten seconds
timer()
{
// wag the tail
doWag();
// restart timer, next ten seconds
llSetTimerEvent(10+llFrand(10));
}
}
any help will be GREATLY appriciated! Ty for your time