aeroson

Untitled

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