Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function OnControllerColliderHit(hit : ControllerColliderHit)
  2. {
  3. if(hit.gameObject.tag == "BOX")
  4.  
  5. {
  6. Destroy(hit.gameObject);
  7. var EXPLOSION = Instantiate(EXP, hit.gameObject.transform.position, hit.gameObject.transform.rotation);
  8. Destroy(EXPLOSION, 5);
  9. gameObject.GetComponent(LegoPlayerMove).ChrSpeed = 5;
  10. gameObject.GetComponent(LegoPlayerMove).anim.SetBool("RUN", true);
  11. yield WaitForSeconds(10);
  12. gameObject.GetComponent(LegoPlayerMove).ChrSpeed = 2;
  13. gameObject.GetComponent(LegoPlayerMove).anim.SetBool("RUN", false);
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement