Placeing Building

Hi
I’m trying to place buildings, the problem is that I need to check how “bumpy” the terrain is, and if it’s to “bumpy” I don’t wan’t to be able to place it. If anyone can help me with this I would be verry grateful. I don’t have a grid as base. I have thought about using 4 raycasts but haven’t figured out how to do that. Pleas help, and if you leaves an exampel, I would prefer C#.
Thanks in advanced an excuse my bad English.

Try to use GetHeights function: