How can I make my game detect whether an array of actors exist in world space ?

So to keep it simple since I don’t have that much experience, I have 8 Y float values in an array and want to check whether an actor has been assigned to any of the Y values (I want to do this for every single value in that array). If an actor has been assigned to that Y value > set a (variablename) bool to true and to not allow another actor to overlap it and be assigned to the same value, but be assigned to the next closest Y value. How will I be able to accomplish that?

(Sidenote : I have also thought of maybe using line traces to accomplish that rather than booleans).

get all actors of class(this node returns all the specified actors in game level) - for each loop with actors- for each loop with array- get actor float value equals get element from for each loop, true - (make a bool here) it contains? = true, false - do nothing. when array completes, branch it contains? equal to true - make your overlap thing. also don’t forget to reset the it contains bool to false in beginning of the for each loop.

Sounds like a task for a Map, you can setup a map of float(key) to AActir object references(value). By default have the value set to none. To check wether an actor is assigned to that key value you could check “is valid” or for more precision the == check as mentioned above to check if it’s of a specific type/class of actor