Spawning enemies inside the level

I’m really new at UE and after trying every method I can think of for days, I gave up and just ask for the solution here.

I’m trying to spawn enemies inside a zone so it won’t fall off the map. I went with an approach in which I attached 4 SphereCollisions with my Character so enemies will appear at a distance from the Char. I choose only one SphereCollision randomly at a time to spawn enemies. Now, the problem is I want to spawn only on a SphereCollision that’s inside the zone I made (or not overlapping with it).

What kind of check should I add to do this correctly?

Also, I tried an approach of making a box trace around but ran to the same problem as above.

I didn’t understand the problem, seems to be ok if you made this array “Possible Spawn Loc” correctly.
I’d start by checking this array, like that


Sorry, it wasn’t clear enough. So, I choose randomly from 4 of those SpawnLocs and because the Character moves the SpawnLoc moves with it and when the Character moves to top left most/bottom right most of the map the SpawnLocs go outside the level. When the random picker chose the one outside the map, the enemy will also spawn outside the map so it will fall off the map. That’s what I want to avoid. I want to remove SpawnLocs that are outside the map or overlapping with an invisible wall that I made in the array that the random picker chooses from and then add it again to the array when it’s not outside the map.

Also, if there’s another approach to solve this problem I’m open to it but post it in screenshot coz I’m really new :slight_smile:

Finally able to resolve this :slight_smile:

Edit : Or so I thought but it seems to be a bugging out ::
Edit 2 : It was the sequence node