How To Find the Height of Level Floor?

I have my player create buildings and then release them into the game world. The challenge is… how to find the Z height of the level floor so I can set the building directly on the floor.
Any suggestions to handle this would be appreciated, thank you.

Perform a line trace from the building(or the player i guess) to the floor and get the hit location?

You can filter what the trace should ignore or not.

As Jacky said, tracing is the way to do it. And filtering can be achieved by creating a custom collision channel and then trace only for that channel.

The BP method is called ‘Single Line Trace By Channel’. To add custom channels check how Epic created custom channels for their ShooterGame. It is all in the projects DefaultEngine.ini under the
[/Script/Engine.CollisionProfile] group, apart you should then also create a define in your main game header (in case its a native project) to make you life easier.

An example (the response can be block or overlap, depending on what you need in each case):

[/Script/Engine.CollisionProfile]

; customized game channel
; if you do this, make sure you define in native for convenience
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1, Name=Floor)

// customize engine profiles, have custom settings for custom responses
// to check the original set up, check BaseEngine.ini
+EditProfiles=(Name="FloorProfile",CustomResponses=((Channel=Floor, Response=ECR_Overlap)))

This would be what goes into your main header (ShooterGame.h in case of Epic example project):

/** when you modify this, please note that this information can be saved with instances
 * also DefaultEngine.ini [/Script/Engine.CollisionProfile] should match with this list **/
#define COLLISION_FLOOR		ECC_GameTraceChannel1

Hope this helps.

EDIT: I’ll resolve the issue. If you still need assistance please re-open it.

what if there is something blocking the floor?

Where you able to achieve your goals?

no1 can ever achieve his goals!