You can make line trace and get normal vector of the ground, with SingleLineTrace and MultiLineTrace functions. Angle is a 2D value, so maybe you need to project this ground vector on some plane and calculate angle. Or maybe it is better to use 3D vector itself.