Hi,
I am a complete noob when it comes to scripting. I have been reading up and trying to make a script that animates my avatar while holding an orb. I have the animations in the root prim of the object (glittery orb) that I want to play through the animations, which includes throwing the ball between my hands etc.
It seems to be on the line I highlighted in red (row 11, column 13). I am drawing a complete blank on it. any help would be greatly appreciated.
integer animNum = 0;
integer numAnims = 0;
integer animPriority = 6;
list anims;
default
{
state_entry()
{
// Get the number of animations in the object and store their names in a list
numAnims = llGetInventoryNumber(INVENTORY_ANIMATION);
for (integer i = 0; i < numAnims; i++)
{
string animName = llGetInventoryName(INVENTORY_ANIMATION, i);
if (llGetAnimationLength(animName) > 0)
{
anims += animName;
}
}
if (llGetListLength(anims) > 0)
{
// Start playing the first animation on priority 6
string animName = llList2String(anims, animNum);
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
llStartAnimation(animName);
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
// Handle the animation permissions
llStopAnimation("");
llSetAnimationOverride("", anims, animPriority);
}
}
changed(integer change)
{
if (change & CHANGED_ANIMATION)
{
// Handle the end of an animation and start playing the next one
string animName = llList2String(anims, animNum);
llStopAnimation(animName);
animNum = (animNum + 1) % llGetListLength(anims);
animName = llList2String(anims, animNum);
llStartAnimation(animName);
}
}