Best way to spawn a new actor on the floor (no user input)

Hi all

Making something like an RTS- currently, as a city expands, it spawns improvements around it. To spawn these improvements, I’m selecting a point nearby on the terrain, then I do a raycast from +1000z to -1000z from the selected point, and then take the hit z as the height for the spawn point. Is this the smartest/most efficient way to get a the height? The terrain and city points are procedural, so I can’t do any prepared points etc.

Yep. Pretty much the only way to do this without some predefined places to build or a builder minion having to walk there first.

Traces / Raycasts are not seriously expensive and since I assume there won’t be hundreds of thousands a second for this usecase you are totally fine in every way.

Thanks for the answer! If it’s not too expensive, I’m totally fine with that method, it just seemed like on of those things that there’s some predefinied function for that I don’t know about yet, being new to UE.

I’m trying to get a trace channel for terrain to work, but have had no joy. Right now, my cities are surrounded by walls of stacked improvements -.-