Enemy AI help

So, I’ve begun working on my own indie game, and I wanted to ask for help or advice on one of the characters’ code. Basically, I want them to have two modes more or less, one where she’s roaming around and will attack if she spots you (which I already have done), and one where she hides somewhere on the map and if the player happens to walk by she’ll pop out and trigger a button mash minigame. I think I can probably handle the minigame part decently enough, but I’ve been completely stumped on the hiding part. Please and thank you if anyone might be able to help!

You’d want Blackboard value that a decision is made upon to either hide or chase. In your case id think a Boolean would work just fine. You could set that on even in your AI BP. from there you have 2 execution trees, sounds like you’ve got the roaming one worked out. The hiding one sounds a little more tricky, and exact execution would depend on what kind of game and systems you’re working with. Id start with maybe setting an array of locations and letting the AI randomly choose one to hide at. Or if you don’t want to go through the process of finding and inputing those vectors manually, you could setup a simple actor that you can place instances of throughout the map/level, get all of those, then select Wich one to move to to hide. The second would probably be easier though less optimal performance wise as that would require additional actors to be loaded into memory.