I want to design an island map in Unreal Engine where flat areas can be built upon, while uneven or steep areas cannot be built upon

I want to design an island map in Unreal Engine where flat areas can be built upon, while uneven or steep areas cannot be built upon. How to do it.

How to obtain landscape height? - Development / World Creation - Epic Developer Community Forums (unrealengine.com)

I think using line trace is a good way to achieve that.