Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Respawn : MonoBehaviour {
- public GameObject Platform;
- public GameObject Text;
- public TimerController TimerScript;
- // Use this for initialization
- void Start ()
- {
- GameObject text = GameObject.Find("CountDownObjectTimer");
- TimerScript = text.GetComponent<TimerController>();
- }
- // Update is called once per frame
- void Update () {
- if(transform.position.y < -2f) {
- transform.position = new Vector3(0, 2, 0);
- transform.rotation = Quaternion.identity;
- Rigidbody playerRigid = gameObject.GetComponent<Rigidbody>();
- playerRigid.velocity = Vector3.zero;
- playerRigid.angularVelocity = Vector3.zero;
- Platform.transform.rotation = Quaternion.identity;
- Platform.GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
- TimerScript.remainingTime -= 15f;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement