I'm making a top down shooter that has doors that open and close using proximity triggers. To do this I've placed created a door and an invisible trigger and placed them in the same container. I've then placed the following event on the event sheet.
If DoorTrigger is overlapping player
If DoorTrigger is overlapping Enemy
Open door. (I simplified this part as it's not the part that's giving me trouble.)
Else Close door.
This piece of code opens a door when the player of an enemy moves over the trigger and closes the door when the player or enemy moves out of the trigger area.
The problem is that if I move in to a trigger area and a door opens, the door won't close unless ALL trigger areas are clear of enemies. An enemy on the other side of the map who is travelling through a door can hold all doors open.
I really don't know how to work around this. Can anyone please help?