using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class SceneController : MonoBehaviour { public GameObject playerPrefab; public GameObject spawner; public GameObject player; public bool debuffed = false; // Use this for initialization private void Start() { Time.timeScale = 1; } // Update is called once per frame void Update () { if (!(GameObject.FindGameObjectWithTag("Player"))&& spawner!= null) { player = Instantiate(playerPrefab, new Vector3(spawner.transform.position.x , spawner.transform.position.y, spawner.transform.position.z),Quaternion.identity); player.GetComponent().isClone = true; } } }