Not to spawn on certain angles

So I am just curious if there is a method to tell objects not to spawn on certain angles such as steep landscape terrain sides or sides of whatever it hits. I am making a blueprint system that spawns random items around the map but I would like to tell it not to spawn on sharp angles or a set angle limit. Wondering how I can get that information as well, someone said something about world space normals not sure if that’s the way to go about it or not. Any advice or help would be great.

Thanks.

you would run a line/sphere trace from the possible spawn point straight down, then in the hit result you will find the normal of the surface.
if you take the vector (0,0,1) which is straight up and compare that against the normal of a surface you can find the angle of the surface. With this set up the return value of 0 is a flat surface and 90 is perpendicular to that, so the steeper the incline the higher the value.

formula:

in this specific case you wouldn’t need to normalize the vectors.

If you’re new to ue4, I’d suggest making your own function library and save this formula in it, it’s useful for all sorts of things. gradually building up a collection of functions like this one can save you time down the road.