Advertisement
salahzar

Script per muovere su un pannello al touch

Jun 9th, 2013
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float STEP=0.5;
  2.  
  3. move(float dx,float dz)
  4. {
  5.     vector pos=llGetPos();
  6.     if(dz!=0) {
  7.         llSetPos(<pos.x,pos.y,pos.z+dz>);
  8.        
  9.     }
  10.     if(dx!=0) {
  11.          vector incleft=llRot2Left(llGetRot())*dx;
  12.          llSetPos(pos+incleft);
  13.     }
  14.  
  15. }
  16.  
  17. default
  18. {
  19.     state_entry()
  20.     {
  21.         llSay(0, "Script running");
  22.  
  23.     }
  24.     touch_start(integer count)
  25.     {
  26.        
  27.         vector touched=llDetectedTouchUV(0);
  28.         if(touched.x<.2) move(-STEP,0);
  29.         if(touched.x>.8) move(STEP,0);
  30.         if(touched.y<.2) move(0,-STEP);
  31.         if(touched.y>.8) move(0,STEP);
  32.        
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement