hey! so i gave this pice of code:
public GameObject player;
void OnTriggerExit (Collider myTrigger) {
if(myTrigger.gameObject.tag == "Player"){
Debug.Log("Box went through!");
myTrigger.gameObject.SetActive(false);
isPlayerVisible = false;
}
}
that works pretty fine, i get the debug log and so on. what i want to do now is, that the Gameobject that should gets deactivated, is a Parent of the Trigger. so the Hierarchie is:
-MainGO
--CharacterController
---myTrigger(the GO that gets turned off at the moment)
i want to turn off the MainGO