So I have a statement in which a player collides with a trigger, it does an action. It’s meant to do everything and then at the end destroy itself. But it won’t work as it will just skip everything and just go to Destroy(gameObject);.
My default Idea was
void OnTriggerExit2D(Collider2D col)
{
if (col.gameObject.tag == "KillZone")
{
Debug.Log("Test");
TestBool = true;
TestInt += 2;
//KillPlayer();
Destroy(gameObject);
}
}
void KillPlayer()
{
Debug.Log("Test Void");
Destroy(gameObject);
}
And what it does is it just skips to Destroy(gameObject) not doing anything else. Once in a while it will run the debug.log but not consistanly. I even tried making it call KillPlayer with destroy disabled within the OnTriggerExit but it won’t call it.
Is there something about how mayb ontriggerexit works that it only calls the most important one something else?
Does anyone know why it might not want to do anything else such as setting a bool to true or calling KillPlayer? Thanks