Objects are still spawning everywhere 4.18

Hi, I’ve got a problem with spawning objects into the free space. My code is pretty much the same as the @sampattuzzi 's one but when I start the game there aren’t even capsules marked on the level.

image I’d be grateful if somebody helped me.

Ok, just copied the code 1:1 from Sam’s github and now it’s working. I’m still wondering why my code didn’t execute properly.

What is different between our code?

As I see now there are default params values in PlaceActors() in my code. It’s strange a bit because it compiled just nicely, isn’t it? Also I was not using GlobalLocation, but it shouldn’t (as I think) affect on at least first Tile.

GlobalLocation might affect the first tile if it’s not at zero

I had a similar problem, the solution was that the random location (CandidatePoint in your code) and subsequent sweep was always performed in the space of the first tile, but you need to add the Tile’s actor location in order to test it:

if (!CastSphere(Location + GetActorLocation(), Radius)) break;

That fixed the issue for me.

Privacy & Terms