llSetAlpha(float alpha,// Transparency value to set, from 0.0 (clear) to 1.0 (solid; clamped to a minimum of 0.1).integer face// Face number orALL_SIDES. Values: Faces
);- Energy
- 10
Sets the diffuse texture alpha (opacity) of face. If face is ALL_SIDES, applies to all faces. Values are clamped between 0.1 and 1.0 (where 1.0 is fully opaque).
Sets the Blinn-Phong alpha on face
llSetAlpha(0.0, 0);Caveats
Section titled “Caveats”-
llSetAlphawill have no visible effect on faces with a PBR material. To work on faces both with and without a PBR material, use one of these snippets: -
invisible
if (llIsLinkGLTFMaterial(LINK_THIS, ALL_SIDES)) {llSetLinkGLTFOverrides(LINK_THIS, ALL_SIDES, [OVERRIDE_GLTF_BASE_ALPHA_MODE, PRIM_GLTF_ALPHA_MODE_BLEND, OVERRIDE_GLTF_BASE_ALPHA, 0.0]);} else {llSetAlpha(0.0, ALL_SIDES);} -
visible
if (llIsLinkGLTFMaterial(LINK_THIS, ALL_SIDES)) {llSetLinkGLTFOverrides(LINK_THIS, ALL_SIDES, [OVERRIDE_GLTF_BASE_ALPHA_MODE, "", OVERRIDE_GLTF_BASE_ALPHA, ""]);} else {llSetAlpha(1.0, ALL_SIDES);}
Examples
Section titled “Examples”Example 1
8 collapsed lines
float cloakSpeed = 0.1;
default{ touch_end(integer total_number) { float alpha = 1.0; while(alpha > 0.0) { alpha -= 0.1; llSetAlpha(alpha, ALL_SIDES); llSleep(cloakSpeed); }10 collapsed lines
state cloaked; }}
state cloaked{ touch_end(integer total_number) { float alpha; while (alpha < 1.0) { alpha += 0.1; llSetAlpha(alpha, ALL_SIDES); llSleep(cloakSpeed); } state default; }}In practical terms, “alpha” means “transparency” or “visibility”.
To be clear, llSetAlpha will only affect the prim that the script it is in. It will not affect any linked prims. To set the alpha state for those, use llSetLinkAlpha
See also
Section titled “See also”Functions
Section titled “Functions”llGetAlpha— Gets the prim’s alphallGetColor— Gets the prim’s colorllSetColor— Sets the prim’s colorllSetLinkColor— Sets link’s colorllSetLinkAlpha— Sets link’s alphaPRIM_COLOR— The equivilant parameter for llSetPrimitiveParamsPRIM_GLTF_BASE_COLOR— The equivilant PBR parameter for llSetPrimitiveParams
Events
Section titled “Events”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.