08-04-2004 21:01
Here's an easy script for keyframe animations of objects in SL. Feel free to mod and make support for more than one frame. Enjoy!

CODE

rotation startframerot;
rotation endframerot;
vector startframepos;
vector endframepos;

default
{
state_entry()
{
startframerot = llGetRot();
startframepos = llGetPos();
llWhisper(0,"Start Position captured");
llListen(0,"",llGetOwner(),"play");
}

touch_start(integer total_number)
{
endframerot = llGetRot();
endframepos = llGetPos();
llWhisper(0,"End Position captured");
(rotation)endframerot;
}
listen(integer channel, string name, key id, string msg)
{
llSetRot(startframerot);
llSetPos(startframepos);
llSleep(3);
llSetRot(endframerot);
llSetPos(endframepos);
llSay(0,"Anim done");
llSleep(3);
llSetRot(startframerot);
llSetPos(startframepos);
llResetScript();
}
}
_____________________
Touche.