// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Ping-pong sprite-sheet motion // Not compiled or tested in-world // Setup: Set FACE and apply a 2×2 sheet whose frames form one outward movement. Owner-touch starts and stops. // Stop / restore: Touch to disable texture animation before removing. The saved diffuse texture/UV settings are restored, but an earlier animation is not recoverable. // Notes: Use a spare prim with readable classic diffuse texture settings. Material behavior can differ with PBR transforms. PING_PONG avoids a hard jump from the final frame to the first. Frames are read left-to-right, top-to-bottom. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer FACE=0; integer active; list saved; default { state_entry() { saved=llGetLinkPrimitiveParams(LINK_THIS,[PRIM_TEXTURE,FACE]); } touch_start(integer count) { if(llDetectedKey(0)!=llGetOwner())return; active=!active; if(active)llSetTextureAnim(ANIM_ON|LOOP|PING_PONG,FACE,2,2,0.0,4.0,2.0); else { llSetTextureAnim(FALSE,FACE,0,0,0.0,0.0,1.0); llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXTURE,FACE]+saved); } } }