So I was trying to build a hiding mechanic into one of my projects that if you would overlap or press a button to enter in a hiding place (like a bush, closet, …) that the enemy would stop following you and start moving in random directions until you leave the place.
Sorry for replying super late, I haven’t seen this post before. I’ve put together a simple example here. You can hide by holding the A button, and stop hiding by releasing it. I’ve made the monster stop chasing you when you hide, but it’s up to you to make it roam around, since I didn’t have much time to implement that. Hope this helps!