Eonirr

Untitled

Feb 11th, 2026
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. IEnumerator MoveOverDistance(Vector3 labas)
  2. {
  3. Vector3 ledebut = new Vector3(0, 0, 0);
  4. Vector3 lameuf = new Vector3 (0,0,5);
  5. float vite = 6f;
  6. Vector3 outukomence = transform.position;
  7. Vector3 verlaoutuva = (lameuf - ledebut).normalized;
  8.  
  9. float plusloin = Vector3.Distance(ledebut, lameuf);
  10. float konbientafait = 0f;
  11.  
  12. while (konbientafait < plusloin)
  13. {
  14. float step = vite * Time.deltaTime;
  15.  
  16. transform.position += verlaoutuva * step;
  17. konbientafait += step;
  18.  
  19. yield return null;
  20. }
  21.  
  22. transform.position = lameuf;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment