How to spawn actors through a sphere trace?

Hey all.

I have an actor that will be spawned with a random amount in it’s “Current Stack Size”. If the current stack size is greater then the max stack size it will sphere trace around it’s own location and spawn another actor that is the same type with the difference in the new actors current stack size. Repeating until enough actors are spawned with the correct amount.

This part will work fine.

The problem is my world is made of hism tiles so the sphere trace will always return a hit. I check the component’s tags to make sure they are a “valid tile” and then if they are will check if any hit actors are = to the landscape that spawns the tiles.

The problem is that it will never detect that the old actors is where it is getting spawned causing all the actors to spawn on each other. And despite it doing a new trace every single time a new one is spawned it will always have the previous location.

The first one will be by itself and then within it’s trace the first impact point will serve as the spawn location for all the next ones. Causing like 10-15 actors to just spawn inside each other.

Edit: Here’s some pictures that show the problem.

Trying to spawn an actor. It needs to spawn on the terrain but not colliding with anything. My terrain are hism instances, so on hit I get class if equal to terrain I make sure it’s the right tile by a tag check.

This works except no matter what I do it will not detect any other actors. So it will just put a bunch of actors inside each other and ■■■■.

Edit: I’ve come to the conclusion it’s most likely a bug. It doesn’t matter what I try to plug into it no matter what the collision settings are or anything the trace absolutely will not detect the hit, it goes right through the actor everytime.

Is the collision preset in the picture of the object you are tracing against? Because you have set the trace response to ignore and in that case that is exactly what it is doing. It ignores your sphere trace.

Are you sure? If I set those 3 to block it elicits no change and If I set the meshes collisions to just “block all” it will still spawn them into each other.

I have no idea why but I just rebuilt the exact same command and turned the static mesh components to “world static” and it worked. I relaunched and turned it back to my custom trace channel and it continued to work, no idea why.