[SOLVED]RaycastHit.Normal returns zeros

First I set the var and make the cast:

var face : RaycastHit;
Physics.Raycast (transform.position, Vector3.forward, face, 2, 9  10);

Later var face is called as follows:

transform.forward = face.normal;

The goal being the raycast gets the world Vector3 of the face it strikes and we set the transform.forward to equal the face normal.

However no matter what face I strike it returns

Vector3(0.0, 0.0, 0.0)

Am I using the wrong command?

You should check that the raycast actually hits something.

–Eric

Thanks Eric,

I ran my script through a huge number of trials and found out that my script editor was not compiling the script properly, so I restarted the editor with the new code, recompiled and it worked!