I want to add safe areas into my game, I am using this code on my player to check if he`s safe right now, however I dont think this is optimised and I want to know if theres a better solution to this.
private void OnTriggerStay(Collider other)
{
if(other.tag == "SafeArea")
{
playerInSafeArea = true;
}
if(other.tag == "DangerousArea")
{
playerInSafeArea = false;
}
}
my scene is set up like its shown in the picture (its 3d)