Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | None | 0 0
  1.  
  2.     void Update ()
  3.     {
  4.         if (animationTimer > 0)
  5.         {
  6.             animationTimer -= 1;
  7.         }
  8.     }
  9.  
  10.     void OnTriggerEnter (Collider other)
  11.     {
  12.         animationTimer += 10;
  13.         if (other.gameObject.tag == "Collectable")
  14.         {
  15.             while (animationTimer > 0)
  16.             {
  17.                 other.gameObject.transform.position = PickUpHelper.transform.position;
  18.             }
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement