Jump to content

Newb Q: Having a texture movement start without a click or touch


WinstonEverlast
 Share

You are about to reply to a thread that has been inactive for 1530 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am trying to create a screen overlay (worn like a HUD) that will start as soon as someone wears it rather than after they click it. I've played around with touch_event which requires a touch (obviously). I then tried using ClickAction(s) but none of them seem to work. Could someone point me in the right direction?

Here is the basic script I'm playing with, the line in bold is what I've having trouble with:

 

integer textureIsBeingAnimated;
 
default
{
    touch_end(integer num_detected)
    {
        if (textureIsBeingAnimated)
            llSetTextureAnim(ANIM_ON | SMOOTH | SCALE |  PING_PONG | LOOP, ALL_SIDES, 1, 1, 1, 5.0, 0.1);
        else
            llSetTextureAnim(FALSE, 0, 0, 0, 0.0, 0.0, 0.5);     
 
        // toggle back and forth between TRUE (1) and FALSE (0)
        textureIsBeingAnimated = !textureIsBeingAnimated;
    }
}

Thanks!

 

Link to comment
Share on other sites

You're looking for an attached event.

attached (key id)
{
     if (id)
     {
          // Do stuff
     }
}

You could continue to use the touch_start event to toggle the animation once the HUD is attached.  Just set textureIsBeingAnimated = TRUE in the attached event to initiate it.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1530 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...