Advertisement
jyourman

Untitled

Aug 29th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Respawn : MonoBehaviour {
  5. public GameObject Platform;
  6. public GameObject Text;
  7. public TimerController TimerScript;
  8.  
  9. // Use this for initialization
  10. void Start ()
  11. {
  12. GameObject text = GameObject.Find("CountDownObjectTimer");
  13. TimerScript = text.GetComponent<TimerController>();
  14. }
  15.  
  16. // Update is called once per frame
  17. void Update () {
  18. if(transform.position.y < -2f) {
  19. transform.position = new Vector3(0, 2, 0);
  20. transform.rotation = Quaternion.identity;
  21. Rigidbody playerRigid = gameObject.GetComponent<Rigidbody>();
  22. playerRigid.velocity = Vector3.zero;
  23. playerRigid.angularVelocity = Vector3.zero;
  24. Platform.transform.rotation = Quaternion.identity;
  25. Platform.GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
  26. TimerScript.remainingTime -= 15f;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement