Unofficial LSL Reference

[[functions:llsetalpha]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Function: llSetAlpha

llSetAlpha(float alpha, integer face)

Sets the opacity (also called alpha) of a face or all faces of the current prim.

Parameters

alpha

A float value between 0.0 and 1.0 being the degree of opacity. 1.0 being fully opaque.

face

An integer value defining the face of the prim to be affected. ALL_SIDES affects all faces.

Notes

  • This function ONLY affects the prim the script is in. To change the alpha on another prim, use llSetLinkAlpha.
  • Note that the viewer shows transparency, not opacity, and it shows it in percentage. To convert from viewer transparency to an alpha value suitable for use with this function, use this formula: alpha=(100-transparency)/100. For example, a transparency of 35% is an alpha value of 0.65.

Short examples

llSetAlpha(0.5, ALL_SIDES); // will set all faces of the current prim to semi-opaque

Complete examples

llSetAlpha-example.lsl
default
{
    state_entry()
    {
        llSetAlpha(0.0, 2);  // Will make face 2 of this prim go transparent
    }
}

See also