void OnTriggerExit(Collider col) { if (col.gameObject.tag == "Player") { resScript = col.gameObject.GetComponentInParent <Transform>().parent.GetComponentInParent <Transform>().Find("ReviveCollider").GetComponentInChildren <Resurection>(); resScript.RemoveHealth(myHealth); } }
// Use this for initialization void Start() { isActing = false; //init gameController DontDestroy parentFunction = GetComponentInParent <DontDestroy>(); attackScript = parentFunction.GetComponentInChildren <Attack>(); resurectionScript = parentFunction.GetComponentInChildren <Resurection>(); capacityScript = parentFunction.GetComponentInChildren <LaunchCapacity>(); defenseScript = parentFunction.GetComponentInChildren <Defense>(); controllerName = parentFunction.controllerName; }