private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { SendToStart sendToStartScript = other.GetComponent <SendToStart>(); sendToStartScript.SendHome(); } }
public void Restart() { timer.playtime = 0; Rigidbody gbrb = gameboard.GetComponent <Rigidbody>(); gbrb.transform.localRotation = Quaternion.identity; foreach (Transform spawnpoint in spawnPoints) { GameObject newSphere = Instantiate(PlayerSpherePrefab, spawnpoint); SendToStart sendHomeScript = newSphere.GetComponent <SendToStart>(); if (sendHomeScript != null) { sendHomeScript.SendHome(); } } }