// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Bobbing exhibit on a pedestal // Not compiled or tested in-world // Setup: Put in a child prim of a nonphysical stationary pedestal. The initial child position is the resting pose. Uses the root’s local Z direction. // Stop / restore: Touch to stop and restore the starting position before removing or resetting. // Notes: Actual child position changes, unlike visual target-omega. Keep the amplitude small and do not relink while running. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. vector home; integer active; default { state_entry() { home = llGetLocalPos(); } touch_start(integer count) { if (llDetectedKey(0) != llGetOwner() || llGetLinkNumber() < 2) return; if (llGetStatus(STATUS_PHYSICS)) return; active = !active; if (active) { llResetTime(); llSetTimerEvent(0.2); } else { llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, home]); } } timer() { if (llGetLinkNumber() < 2 || llGetStatus(STATUS_PHYSICS)) { llSetTimerEvent(0.0); active = FALSE; return; } llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL, home + <0.0, 0.0, 0.12 * llSin(llGetTime())>]); } }