integer g_is_rotating = FALSE;
default
{
// toggle state during the touch handler
touch(integer num)
{
if(g_is_rotating)
{
// turn off rotation
llSay(0,"turn off rotation");
llTargetOmega(<0,0,1>, 0, 0);
g_is_rotating = FALSE;
}
else
{
// rotate around the positive z axis - up.
llSay(0,"rotate around the positive z axis - up.");
llTargetOmega(<0,0,1>, 4, 1);
g_is_rotating = TRUE;
}
}
}
//这段脚本是Linden Scripting Language Guide 中的,我把它应用到物体上,我的物体为何不会旋转?哪位高人给解释一下?
//点击物体时的确看见了 ,"turn off rotation"和"rotate around the positive z axis - up."的,保证脚本得到运行了的。