How to make AI spawn buildings correctly? (I have my own solution but its just bad)

You are only using the variables on the AI actor to build the building. Which might not have enough information to make it look good. In Age of Empires, player places down a framework of building and move the AIs to build it. It’s the player spawning the building from UI, not the AI actor.

I don’t see a lot of games letting AI to just spawn a building. Usually the player plans the building and AI builds it according to player’s plan.

You will need a decoy building. Move the decoy around and update collision detection.

Now on the decoy actor itself handle unbuildable cases. Like collision to other buildings/pawn/environment.
image

Also check Z axis to make sure the building isn’t floating. Or on top of another.

To make building spawning look good is boiled down to handling unbuildable cases and setting up detections.