You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

50 lines
807 B

using UnityEngine;
using System.Collections;
public class respawners : MonoBehaviour {
private bool player1;
private bool player2;
public GameObject respawnPoint;
public GameObject deathTrigger;
public bool objective = false;
private checkpoint deathScript;
// Use this for initialization
void Start () {
deathScript = deathTrigger.GetComponent<checkpoint> ();
}
// Update is called once per frame
void Update () {
}
void OnTriggerStay(Collider other) {
if (other.name == "Player1")
player1 = true;
if (other.name == "Player2")
player2 = true;
if (player1 && player2) {
if (objective) {
Application.LoadLevel("CreditScreen");
}
deathTrigger.SetActive(true);
deathScript.respawnPoint = respawnPoint;
gameObject.SetActive(false);
}
}
}