Sunbleached Posted October 11, 2017 Share Posted October 11, 2017 (edited) Hello! I'm looking for a script to simulate the work of the loudspeakers. I managed to find two scripts that move the object forward backward. But they do not work on linked objects. I decided to try a method with texture animation. Question is how this script should look like slightly stretching - reducing the picture (speaker)? Please help! llSetTextureAnim(ANIM_ON | SMOOTH | SCALE | PING_PONG | LOOP, ALL_SIDES, 1, 1, 1.0, 3.0, 2.0); As I understand there must be this line. And I can not make it the on / off. integer textureIsBeingAnimated; default { touch_start(integer num_detected) { if (textureIsBeingAnimated) llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES, 1, 5, 0.0, 0.0, 1.0); else llSetTextureAnim(ANIM_ON | SMOOTH, ALL_SIDES, 1, 5, 5.0, 1.0, 1.0); // toggle back and forth between TRUE (1) and FALSE (0) textureIsBeingAnimated = !textureIsBeingAnimated; } } Edited October 11, 2017 by Sunbleached 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted October 12, 2017 Author Share Posted October 12, 2017 I found answer already but any suggestions are welcome! Thanks! integer gON; default { touch_start(integer num) { gON = !gON; // Here's the switch ... if (gON) // So, let's test it .... { llSetTextureAnim(ANIM_ON | SMOOTH | SCALE | PING_PONG | LOOP, ALL_SIDES, 1, 1, 1.0, 3.0, 2.0); // It's on. } else { llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0); // It's not. } } } 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now