Player moving within multiple trigger volumes

Hey guys, I’m trying to implement a stealth mechanic and have a few trigger volumes that set the character state to “hidden” when it is overlapping. At the moment, I have the EndOverlap event to set “hidden” to false. The problem is, when i have a few volumes overlapping each other, there’s a lot of flip flopping when the character exits the 1st volume.

Any ideas on how to implement this? I’m really new to scripting generally lol.

Create an integer variable in your player character, something as “BeingOverlappedCount”. Set its default value to 0. Every time you start overlapping something, increment the value of the variable by 1. When “EndOverlap” event gets triggered, subtract “BeingOverlappedCount” by 1 and verify if its value is equal to 0, if it is then set your character state to hidden.

Ah thanks! that worked!