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