what does raycastHit.normal return exactly

so i have been looking at raycastHit.normal to acheve the following, i want a raycast to detect what is directly in front of the crossair, and unless its a block i want to spawn a block at the surfase hit rotation and 2 units away in the normal direction of that surfase. i am not sure if i am explaining my self well. but the problem is quite simple, raycastHit is returning a vector3 and every float in that vectro 3 is in a range of -1 to +1 it seems. what does that represent exactly?

im sorry for the dumb question but i wabnt to makle sure i get it. thanks a lot in advanced.

18849-surface_normal2.png

If your raycast hit on this surface is at the base of an arrow in this image, the arrow is what gets returned. Note the arrow is normalized, so its magnitude will be 1.0. RaycastHit.normal is a vector, so it does not include the position of the hit…just the direction. RaycastHit.point is the point of the hit.

hit.normal returns a vector3 as has been stated above. The numbers will be floats and range from -1 to 1. Debug a hit.normal and it will look something like (0.3f, 0.9f, -0.6f.)

If you take a sphere and cut it down the middle with a plane on the x, y, or z axis, the hit.normal of that plane would return 1.0 or -1.0 for the respective axis because the plane is facing directly in the direction of the axis.

For instance, you wish to determine the slope of your terrain. You raycastHit and the hit.normal returns 0.0f, 1.0f, 0.0f. In this instance, the slope of the terrain is completely flat as the hit.normal is aimed directly up the y axis. Similarly in this instance, the x and z values are both 0.0f because the hit.normal is aimed directly 90 degrees from both of these axis.

So 0 degrees is 1.0f, 45 degrees is 0.5f, 90 degrees is 0.0f, 135 degrees is -0.5f, and 180 degrees is -1.0f. Adjust by increments of 9 degrees for every point difference.