11-19-2005 08:55
I'm using code I've used before on other projects for the positioning and rotation, so I'm fairly sure that it works.

However, this time, I'm trying to use touch as a toggle instead of voice commands, and I am getting some weird behavior, like it running through the entire process 3 times before returning to it's original state.

Am I making a dumb mistake? Can you help?

the controller code:

CODE
string screen = "open";
default
{

touch_end(integer total_count)
{
if ( screen == "open")
{
llMessageLinked(-2, 0, "close", NULL_KEY);
screen = "closed";
}

if ( screen == "closed" )
{
llMessageLinked(-2, 0, "open", NULL_KEY);
screen = "open";
}
}
}