Blueprint collision test

Hi, i want to put objects from blueprint to my level to random places , but i dont want them to overlap. So when 2 objects would overlap, i want to delete one of them. Collision boxes working fine at runtime but not at compile time, idk why. Anyone has sugggestions? Thanks

Hey there @davidok0! Welcome to the community! We’re going to need a bit more information about your objects, their collisions, how you’re spawning them, and your use case. This information will help us determine where the fault is.

Are all of the collisions for the objects failing and they just naturally overlap?

Are you checking hits or overlaps?

I add the objects with the “Add Child Actor Component” method from blueprint. The objects event graph is very simple, when component begins overlap or gets hit, I call destroy actor. So when i place 2 objects to the same place botb of them shoul be destroyed, but nothing happens. But if I hit them with the character, they get destroyed.

Ahhhh there’s the issue. So off the bat your problem is that the add child component actor isn’t going to check for overlap or hit events against what’s effectively itself. Might I recommend a better node?

I’d recommend using the spawn actor node, as it can see if there will be a collision and adjust the spawn or just not spawn an object outright. Then you can attach it after the fact. A little example here.

This effectively does the same thing, but this way you don’t have to do any extra collision checks as the spawn actor function does it for you!

That works! Thank you so much!