gosha gosha

Generation

generate functionSun, 12 Feb 2023

If an enemy is nearby, the door will automatically close. 

private void OnTriggerEnter(Collider other) { if (other.CompareTag("Enemy")) { Debug.Log("EnemyIn"); doorClose = true; } } private void OnTriggerExit(Collider other) { if (other.CompareTag("Enemy")) { Debug.Log("EnemyOut"); doorClose = false; } }

Questions about programming?Chat with your personal AI assistant