HomeAll
Store›MorganeParis›Light Drain And Restore Script
Light Drain And Restore Script

Light Drain And Restore Script

49
Log in to like
Item name
Light Drain And Restore Script
Category
Scripts
Min. resale price
50
Listed
10/8/2025

Description

Version 1.8.1 Add a soft, theatrical lighting effect to a lamp, a lantern, a crystal or any prop your visitors can pick up. While the object is held, its light gradually drains and a smooth rainbow cycles through the light color and the material tint; the glow of the materials follows the light. When the object is released, the light restores to its target intensity and the color fades back to white, or stays on the color the visitor picked by letting go. No scripting skills needed. New in 1.8: the light is written only when its value really changes, with anti-flicker thresholds, at most 15 times per second and never at rest. Debug Logging now works. A wrong setup (no scriptable light, no scriptable mesh, a name that matches nothing) is reported in the script console. Settings grouped by category in the Build panel. Fully standalone. ________________________________________ Key Features While held • Light intensity drains at your pace, down to a minimum • Smooth rainbow on the light color and the material tint (speed, saturation, brightness, smoothing) • Emissive intensity of the materials follows the light, shaped by a gamma On release • Light restores to a target intensity • Color fades back to white, or is latched: visitors "pick" a color by letting go Start • Start After First Grab: an untouched lamp keeps its editor look • Start From Current Intensity, Force White At Init Materials and light • Light Name Filter: the light to drive (empty = first scriptable light) • Material Name Filter: every material of the first scriptable mesh, or one name on every scriptable mesh (case ignored) • Anti-flicker: throttled material writes with an engine-side fade ________________________________________ Technical Details • 24 settings in eight groups: Start, Light, Intensity, Emissive, Material, Rainbow, Release Color, Debug • Requires a grabbable physics object, a Scriptable light and a Scriptable mesh whose material has Tint or Emissive Intensity • At most 15 light writes per second, none at rest (1.8) • Warnings in the script console for a missing light, mesh or RigidBody and for a name filter that matches nothing • Optional Debug Logging: light and materials chosen, each grab and release, writes per minute • A material or light that keeps refusing its writes is dropped, the rest goes on ________________________________________ Example Uses • Lanterns and torches in a quest or an escape room • Crystal balls, magic orbs, lightsabers • A "color picker" lamp: let go on the color you like • Party props and glowing toys ________________________________________ Full documentation online: https://mpp-mainstore.com/sansar/LightDrainAndRestore/ ________________________________________ Updating from 1.7 • Your settings are kept when you update the script: the 24 settings keep their values, only their labels change and move into groups. Take a screenshot of the Build panel first, update one object and check it before doing the others. • What changes: nothing is written while the object rests; with Force White At Init off and Start After First Grab on, nothing is written before the first grab; an empty Material Name Filter takes the first scriptable mesh; Debug Logging (the old "Debug Log") now really writes to the console. Changelog — Version 1.8.1 • Version number only. Changelog — Version 1.8.0 • Light writes with anti-flicker thresholds: at most 15 per second, one exact write when the value stops, none at rest. • Debug Logging works: chosen light and materials, grabs and releases, writes per minute. • Warnings at start for a missing light, mesh or RigidBody and for a name filter that matches nothing. • Each light and material write is guarded; a failing material or light is dropped, the others keep going. • Material Name Filter searched on every scriptable mesh; both name filters ignore case and outer spaces. • Effects follow the real elapsed time. • Settings grouped by category. Changelog — Version 1.7 • Smooth rainbow (temporal smoothing), emissive sync with gamma, color latch on release, start after first grab, throttled material writes. Thanks to Nicci for her excellent suggestions and help. ________________________________________ Enjoy and Keep Good Vibes. Hugs from Morgane. ________________________________________

Light Drain And Restore Script | Sansar Store — Sansar