Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Activating an animation when clicking an attached object?

woofbag Fudo
Registered User
Join date: 3 Aug 2006
Posts: 31
08-28-2007 09:58
I recently made an animation for something I'm working on, and I need the animation to activate when I click the object, then turn off when I click it again, then turn back on if I click it again, etc. How is it done?
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
08-28-2007 10:44
Well touch_start() and state changes would be a good start for that

something like

[script]

default
{
touch_start(integer num_detected)
{
//script to start animation here

state on;//moves to on state

}
}

state on
{
touch_start(integer num_detected)
{
//script to stop animation here

state default;//moves back to default state

}
}

[/script]

thats the basics of touches and state changes. You would need to drop in the animation overide scripting into each state.

Also this is just from memory so check the wiki for more accurate uses of states and touches.

http://www.lslwiki.net/lslwiki/wakka.php?wakka=HomePage
_____________________
Tread softly upon the Earth for you walk on my face.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
08-28-2007 11:08
That should work I think, but you need to add the llRequestPermissions for PERMISSION_TRIGGER_ANIMATION
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
08-28-2007 11:12
Don't forget to get PERMISSION_TRIGGER_ANIMATION. With an attachment, it will always be granted without explicitly asking the avatar, but one still needs to get it (and perhaps to have a run_time_permissions() event handler--I think).
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
08-28-2007 11:13
Yes I missed out the permissions part due to forgetfulness. You might want to check this thread which discusses some of the same issues.

/52/4f/206740/1.html#post1651994
_____________________
Tread softly upon the Earth for you walk on my face.
woofbag Fudo
Registered User
Join date: 3 Aug 2006
Posts: 31
08-28-2007 15:16
From: Django Yifu
Yes I missed out the permissions part due to forgetfulness. You might want to check this thread which discusses some of the same issues.

/52/4f/206740/1.html#post1651994/52/4f/206740/1.html#post1651994

Thanks, but I think that's for activating the animation whenever anything is clicked.