Vector3 won't Normalize?

I’m normalizing a Vector3 like so:

normalizedVector = hit.normal.normalized;

But in the inspector it’s showing values of X: 0.1, Y:0.9, Z: -5

This is the only instance of the normalisedVector variable in the script. Shouldn’t all the values be between zero and 1?

Normalize means the length of the vector needs to be 1. If all values were between 0 and 1, it would be shorter than 1 in most cases and the negative directions wouldn’t be possible at all.

thanks, Math isn’t my strong point :wink:

I’m not sure what the deal is here, but the magnitude of a Vector3 with {0.1, 0.9, -5} is much larger than 1. It is ~5.08, and you can test this in Unity or WolframAlpha.

Debug.Log(new Vector3(0.1f, 0.9f, -5).magnitude);
Debug.Log(new Vector3(0.1f, 0.9f, -5).normalized.magnitude);

It’s also worth noting that a normal already has a magnitude of 1

No differently than normalizing a vector with a magnitude over 1.

Either you’ve mistyped those values or your are not assigning the normal to the vector3 exposed in the inspector.