What is happening ???

I was going through a CharacterController tutorial . In that tutorial i stuck on the following two statement …

    forward = transform.forward;                          /* Both Vector3
right = Vector3(forward.z, 0, -forward.x);                             */

what is -forward.x ??? what is its purpose ?

forward is a Vector3 which is assigned to transform.forward.
transform.forward is the Vector3 pointing straight forward from the transform position and rotation.

So -forward.x means the negative value from the forward Vector3 on the X-axis.

More Information:

Hope it’s helpful in your case.