Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1.     public void MoveAnim()
  2.     {
  3.         float waitedTime = 0;
  4.         // if it is not in the destination, keep moving
  5.         while (this.transform.position != _destination.transform.position)
  6.         {
  7.             waitedTime += Time.deltaTime;
  8.             transform.position = Vector3.MoveTowards(transform.position, _destination.transform.position, speed);
  9.         }
  10.         currentPos = _destination;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement