Download

Fastest way to query number of actors of type in sphere?

In my small game i need to figure out if any blocking objects are within a certain area of an actor.
I used the sphere object to define the radius, the sphere is set to Generate overlap events, overlapAll
I have set the object to query to have Generate Overlap events, overlapAll

In the the graph i have a GetOverLapingActors set to the class type I am interested in “House”
On the array out i do a length, if length is zero the volume should contain no "House"s, and we can build one.

Except I allways get zero houses and the actor will keep building houses in the same location…

What might I possible have missed, missjudged?

I saw now that there is a actual funktion for the call. I will try that tomorrow. Sphere Overlap Actors.

I will get all actors except the one I am after. If i try to add a filter for the actor I am after, I allways get an empty array. Even if I know the actor exists in the world, I can see it, it is resposible for spawning the actor actually doing the query…

Ok figured this one out. The object i could query was not identical, it contained a sphere, and that sphere hade intersectall as collision type.
Now I can filter out the house properly. :slight_smile: