// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Face child toward root center // Not compiled or tested in-world // Setup: Use offset nonphysical child; owner-touch previews/restores. // Stop / restore: Owner-touch again to restore the startup snapshot before removal or reset, unless setup describes a different cycle. Do not relink during a preview. // Notes: Use a spare modifiable build. Saved state lives only in script memory. Roll is chosen by llRotBetween, not a camera-style up-vector constraint. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer preview; rotation home; default { state_entry() { home=llGetLocalRot(); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; if(llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS)||llVecMag(llGetLocalPos())<0.01)return; preview=!preview; if(preview) { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROT_LOCAL,llRotBetween(<1.0,0.0,0.0>,-llVecNorm(llGetLocalPos()))]); } else { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROT_LOCAL,home]); } } }