1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

LSL Animesh サンプルスクリプト

Last updated at Posted at 2018-12-27

Twitter で初期化がうまくいかない時があるとかいてしまいましたが
再生したアニメをすべて破棄すればうまくいくようです

以下サンプル
スクリをリセットする際に Object が握っているアニメーションをすべて停止します

[sample_start_animesh.lsl]
string g_anim = "つかいたいアニメ";

stop_all_animations()
{
    list curr_anims = llGetObjectAnimationNames();
    integer i;
    
    for(i = 0 ; i < llGetListLength(curr_anims) ; i++)
    {
        string anim = llList2String(curr_anims, i);
        llStopObjectAnimation(anim);
    }
}

default
{
    state_entry()
    {
        stop_all_animations();
        llStartObjectAnimation(g_anim);
    }

    attach(key id)
    {
        if(id)//有効なキーか NULL_KEY かを調べます
        {
            llStartObjectAnimation(g_anim);
        }
        else
        {
            llStopObjectAnimation(g_anim);
        }
    }
}

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?