SecondLife Tutorial: Setting Linked Objects A Certain Color

Comment 1 Standard

For objects with multiple parts in SecondLife you need to use LlSetLinkColor. What this does is goes through the object and picks up anything its linked to. This way it will change the color of all other things its connected to. I also figured out how to change the alpha values of the objects so they appear and disappear when clicked.

if (llGetColor(ALL_SIDES) == white) //the block is already white
{
      llSetColor(black, ALL_SIDES);
      llSetLinkColor(LINK_ALL_CHILDREN, black, ALL_SIDES);//change transparency
      llSetAlpha(.5, ALL_SIDES);
      llSetLinkAlpha(LINK_ALL_CHILDREN, .5, ALL_SIDES);
}
else
{
      llSetColor(white, ALL_SIDES);
      llSetLinkColor(LINK_ALL_CHILDREN, white, ALL_SIDES);//change transparency
      llSetAlpha(1, ALL_SIDES);
      llSetLinkAlpha(LINK_ALL_CHILDREN, 1, ALL_SIDES);
}
Advertisements

One thought on “SecondLife Tutorial: Setting Linked Objects A Certain Color

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s