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
Your answer
![](https://koobas.hobune.stream/wayback/20220612082735im_/https://answers.unity.com/themes/thub/images/avi.jpg)