Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

move child prim

ValkyrieJanet Sep 22nd, 2018 (edited) 31 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. // turn and move child prim on chat commands
  2. // JR 2018-09-22
  3.  
  4. turn() {
  5.   llSetText("turn", <1,1,1>, 1);
  6.   rotation smallAngle = llEuler2Rot(<0,0,15>*DEG_TO_RAD);
  7.   rotation newRot = smallAngle*llGetLocalRot();
  8.   llSetLocalRot(newRot);
  9. }
  10.  
  11. step() {
  12.   llSetText("step", <1,1,1>, 1);
  13.   vector forward = <0.05,0,0>; // short step on X
  14.   vector toMove = forward*llGetLocalRot(); // point as I point
  15.   vector newPos = llGetLocalPos()+toMove;
  16.   llSetPos(newPos);
  17. }
  18.  
  19. process(string message) {
  20.   if ( message == "turn") {
  21.     turn();
  22.   } else if ( message == "step" ) {
  23.     step();
  24.   } else {
  25.     llWhisper(0, "impossible");
  26.   }
  27. }
  28.  
  29. default {
  30.   state_entry() {
  31.     llListen(10, "", "", "turn");
  32.     llListen(10, "", "", "step");
  33.   }
  34.  
  35.   listen(integer channel, string name, key id, string message) {
  36.     process(message);
  37.   }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top