Still working on a 2D overhead game. So now I realized that the script I am using for DontDestroyOnLoad is deleting the original player that I am using.
DontDestroyOnLoad(transform.gameObject);
if (GameObject.Find(gameObject.name)
&& GameObject.Find(gameObject.name) != this.gameObject)
{
Destroy(GameObject.Find(gameObject.name));
}
This is the code that I am currently using to delete duplicates, but when loading back to the original scene, it deletes the original and messes up the whole rest of the code, such as the start points I am using.
Does anyone know how to fix this?
↧