Set location of a spawn actor so that it stands perfectly on the ground?

Hi,

question is in the title. I need the BP solution :smiley:

Thanks in advance :smiley:

The BP solution is mostly here…

Then you need to ge tthe Actor exactly on the ground. I just use a fudge factor to add a little to Z so they are a hair
off the ground. Or add a bit mor and they fall for 0.5 seconds to the ground on spawn.

But…

If there is an obstacle like a rock, building, etc on that spot then you have to get smarter about where you spawn.
Thus there are Player Start points in Unreal that you place by hand.

You can also loop through the hit list in the BP solution and decide which surface has priority.
Buildings are a problem because the roof may not be a good spawn point, so you search downard for a floor surface.
And it can get very complex.

Another approach is to always spawn on open griound and do a random search within a rectangle of where you want to spawn. Maybe within Β±50 meters. And limit your tries to maybe 50. If you can;t find a spot in 50 tries just spawn anyway 0.5 meters above the highest solve point so they fall to the roof/rock/tree/whatever.