llStartAnimation(string anim);
Triggers the
animation anim. In order for this to work, the
script must have the
PERMISSION_TRIGGER_ANIMATION permission on an
avatar. See
llRequestPermissions and
llGetPermissions for more information on
permissions.
Built-in animations always work, but if
anim is a custom animation, it must be contained in the
inventory of the scripted
prim.
It is usually good practice to check
llGetPermissions before
calling this
function. The fact that this is not usually done is the reason so many "Script trying to trigger animations but
PERMISSION_TRIGGER_ANIMATION permission not set" messages happen, which can be annoying (especially if they keep trying over and over).
An animation which doesn't end on its own can be stopped with
llStopAnimation.
To animate someone
sitting on an
object, it's a good idea to stop the generic sit animation first (
llStopAnimation("sit")) unless the new animation has a higher priority than the default sit.
- Note that although the PERMISSION_TRIGGER_ANIMATION permission is automatically granted when sitting, a prior call to llRequestPermissions is required -- see sample scripts.
- Note also (as mentioned in llSitTarget) that exact visual avatar placement for a given coordinate set is in fact rather uncertain, especially with custom animations. It will vary depending on chosen animation, and more critically between different avatars due to their size, shape, and even gender (sometimes very large offsets).
See
animation for a current list of built-in standard animation names.
ExampleAnimationScript shows an example of this function's use (it is the freely-distributed animation script many people use).
Compare with
llStopAnimation.
Note: while the
official documentation claims "This function starts animation
anim for the avatar that
owns the object.", this is incorrect; as long as permissions have been granted,
any avatar can be animated using
llStartAnimation -- chairs, pose balls, whatever. (Another example: driver and passenger seat on vehicle can usually seat anyone -- sit animation -- even though driving is normally restricted to owner.)
Q: Is there a way to load an animation from a key?
A: No.
A: This is a change from older script behavior, one of several copy protections to have been added to LSL in 2006. - Ice
A: This wasn't a change added in 2006, key support never made it out of the 1.4 Preview. I take full credit for this (I flaunted an animation logger with playback functionality in front of a few lindens). Sex animations can be pretty funny out of context. - BW
This article wasn't helpful for you? Maybe the
related article at the LSL Portal is able to bring enlightenment.
Functions |
Agent/Avatar |
Animation