// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Fading privacy window // Not compiled or tested in-world // Setup: Put in a spare window prim. Set FACE; owner-touch changes the target opacity. Use a face/material whose alpha mode supports blending. // Stop / restore: Touch to return to the original opacity, wait for the fade to finish, then remove. Resetting mid-fade captures the altered opacity. // Notes: Transparency is visual, not privacy or access security. It does not change the object’s collision geometry. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. integer FACE = 0; float original; float target; float current; integer clear; default { state_entry() { original = llGetAlpha(FACE); current = original; target = original; } touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; clear = !clear; target = original; if (clear) target = 0.15; llSetTimerEvent(0.1); } timer() { float difference = target - current; if (llFabs(difference) <= 0.05) { current = target; llSetTimerEvent(0.0); } else if (difference > 0.0) current += 0.05; else current -= 0.05; llSetAlpha(current, FACE); } }