aeroson

Untitled

Jul 19th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1.  
  2. class XXXXXXX
  3. {
  4.  
  5. ....
  6.  
  7. private var currentRotationCircleAngle : float;
  8.  
  9. ....
  10.  
  11. timer function XXXX( deltaTime : float , id : int)
  12. {
  13.  
  14. var playerPos : Vector;
  15. var playerRot : EulerAngles;
  16.  
  17. var wispPos : Vector;
  18. var wispRotationCircleRadius : float;
  19. var wispSpeed : float;
  20.  
  21. wispSpeed = 10;
  22. wispRotationCircleRadius = 1;
  23.  
  24. currentRotationCircleAngle += deltaTime * wispSpeed;
  25. while(currentRotationCircleAngle > 360) currentRotationCircleAngle -= 360;
  26.  
  27. playerPos = thePlayer.GetWorldPosition();
  28. playerRot = thePlayer.GetWorldRotation();
  29.  
  30. wispPos.X = playerPos.X + CosF(Deg2Rad(currentRotationCircleAngle)) * wispRotationCircleRadius;
  31. wispPos.Y = playerPos.Y + SinF(Deg2Rad(currentRotationCircleAngle)) * wispRotationCircleRadius;
  32. wispPos.Z = playerPos.Z + 2;
  33.  
  34. this.TeleportWithRotation(wispPos, playerRot);
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment