So I have this code to respawn my player when he hits his enemy. Everything works fine, but when the players spawn, he's uncontrolable. For some reason the Player clone has the controller script unchecked in the inspector.
Anyone have any idea as to why that happens & how to solve it?
using UnityEngine; using System.Collections;public class RedEnemy : MonoBehaviour {
GameObject spawnPoint; GameObject Player; // Use this for initialization void Start () { spawnPoint = GameObject.Find ("spawnPoint"); Player = GameObject.Find ("Player"); } //collider void OnTriggerEnter ( Collider other ){ if (other.tag == "Player") { Destroy (other.gameObject); GameObject Clone; Clone = Instantiate(Player, spawnPoint.transform.position, Quaternion.identity) as GameObject; } }
}