Sphere Trace for Objects random vectors

Hey guys,

I have been trying to use a work-around for the collision detect for the SpawnActor block. I have tried a modified implementation of this work-around: Spawn Even if Colliding - Blueprint - Epic Developer Community Forums but to no avail.

I am spawning objects constantly, and I would like to not have them overlap. Unfortunately, when the object spawns at a random location within the set parameters, the resulting sphere trace for objects is typically very wrong.

As you can see from the blueprint, I am feeding the sphere check for objects directly from the spawn vector return value, and it is a point.

Any help appreciated!

Pics:

I can’t expand your images, so some of this is me squinting and guesstimating.

But it LOOKS like your problem would be your random number generator. Every time a node accesses that, it gets a new value. What you want is to check a random value, make sure there are no collisions, and if not, then spawn something.

The only way that is going to work is if you STORE your random number in a variable first. Then you’ll use that variable for your trace and for your spawning. Just remember that if your trace has the same start and end points, it won’t happen, so add some sort of offset.

With a variable, you “lock in” the random value, which is important in your case. Random Float In Range is built to provide a different number each time the node is called, which is more than like your issue, as far as I can tell from here.

Thanks a bunch, that fixed it.