problim with dontdestroyonload and counts death as 2
so im having 2 problems wich is
private deathCounter gm;
public static int deaths = 1;
void Start()
{
gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<deathCounter>();
}
void OnTriggerEnter2D(Collider2D col)
{
if (col.tag == "Player")
{
DontDestroyOnLoad(gameObject.GetComponent<GUIText>());
gm.deaths += 1;
}
}
}
Comment