Download

Problem with getting normal of ground and rotation

Hi guys, im trying to set the rotation of a mesh to the direction of the normal of the ground(also a mesh). I managed to get the normal angle, but it only gets positive numbers.

Here is an image to ilustrate my problem:
86af58af2cb35c6305637a8557d043a8181d8e75.png
First angle is correct, it is 45. But the second it spits out 45, when i should get (if i did it right jaja) -45.
1b69efdfd1d88b4e9969bfabed465b9a50fdb8f2.png

This is how im getting the normal:
53e4498c6e2247dee4d7d222d5a6c67b703fc02c.png

How can i fix this problem?

Thanks!