OsAvatarPlayAnimation

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
Line 37: Line 37:
 
====See Also====
 
====See Also====
 
*[[osAvatarStopAnimation]]
 
*[[osAvatarStopAnimation]]
 +
*[[OSSL_Script_Library/OSSL_Poseball|OSSL_Poseball script]]

Revision as of 03:58, 18 March 2012

void osAvatarPlayAnimation(key avatar, string animation)
This function causes an animation to be played on the specified avatar.

The variable animation can be either the name of an animation within the task inventory, or it can be the animation's UUID.

Instead of the name of an animation in the prim's inventory, you can also use the names of the viewer's built-in animations.

osAvatarPlayAnimation does not perform any security checks or request animation permissions from the targeted avatar.

Threat Level VeryHigh
Permissions No permissions specified
Delay No function delay specified
Example(s)
//Example Usage: 
default { 
  touch_start(integer num) 
  {
    string anim = llGetInventoryName(INVENTORY_ANIMATION, 0);
    osAvatarPlayAnimation(llDetectedKey(0), anim);
  }
}
Notes
When using this function in an object that requires the user to sit on the object (like a chair,or a poseball), you will need to stop the sit animation by including the following snippet:
changed(integer change)
{
  if (change & CHANGED_LINK)
  {
    key user = llAvatarOnSitTarget();
    osAvatarStopAnimation(user, "sit");
    osAvatarPlayAnimation(user, anim);        
  }
}


See Also

Personal tools
General
About This Wiki