Answers for "unity clone don't destroy on scene load"

C#
0

unity clone don't destroy on scene load

private static Player playerInstance; 

void Awake(){     
	 DontDestroyOnLoad (this);
	 
  if (playerInstance == null) {         
 	playerInstance = this;     
	 } 
  else {
 	DestroyObject(gameObject);
 	} 
 }
Posted by: Guest on August-11-2020

C# Answers by Framework

Browse Popular Code Answers by Language