Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var bar : UIProgressBar;
  2.  
  3. function Start()
  4. {
  5.     bar = GetComponentInChildren(UIProgressBar);   
  6.    
  7. }
  8.  
  9.  
  10. function Update () {
  11.     transform.position.z = 25;
  12. }
  13.  
  14. function OnCollisionEnter( other: Collision)
  15. {
  16.     if(other.gameObject.tag == "egg")
  17.     {
  18.         Debug.Log("you have been egged");
  19.         bar.Value = 0.1;   
  20.     }  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement