Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

New HUD question

Amiz Munro
Registered User
Join date: 8 Jul 2008
Posts: 54
02-15-2009 06:04
I made a HUD of sorts 6 prims linked together each containing a animation and this script:

CODE

integer ani = 1;
string gAnimName = "animation here";

default{
touch_start(integer num_touch)
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}

on_rez(integer param)
{
llResetScript();
}

run_time_permissions(integer perm)
{

if (perm & PERMISSION_TRIGGER_ANIMATION)
{
if(ani){
llStartAnimation(gAnimName);
}
else
{
llStopAnimation(gAnimName);
}
}
ani=!ani;
}
}


That works fine, I can click on each button and they animate the av but I dont know how to stop them. I made a stop button as well and linked it, and added a stop all animations in a list but I'm still stuck in a pose.

Where did I go wrong? Or is there a better way to make a HUD?

Thanks in advance
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
02-15-2009 08:03
Your if test will return either 1 or -1, depending on how the variable ani has been flipped. FALSE is not -1, though. It's zero. Try changing the test to

CODE

if (ani ==1)
llStartAnimation(gAnimName);
}
else if (ani == -1)
{
llStopAnimation(gAnimName);
}
[\php]