Making Vector From Vector

image seys it all

Update:
To clerfy i am trying to make cart game, box represent the kart and when i addforce to box so it moves forward it will fly off if angle of floor changes and i cant use chessBoard.transform.right cuz chessBoard is just for testing and terrain on witch kart will drive can be deformed mesh

So i got on irc this formula will taste it later
Vector3 yellowDir = rayDir - normal * Vector3.Dot(rayDir, normal)

Simply use Vector3.Project to project your green vector onto the normal. That gives you the amount of the green vector along the normal. If you subtract that from the green vector the resulting vector points along the yellow axis.

Note: If the green vector and the normal are identical (point in the same direction) the result is a vector very close to (0,0,0). The greater the angle between your raycast and the normal is the larger the yellow vector gets.

This is very simple in 2D. Given the Vector2 normal. The tangent is just new Vector2 (-normal.y, normal.x). Or new Vector2(normal.y, -normal.x).

In 3D, there are infinitely many vectors that are perpendicular to the normal (or any Vector3) so you have to narrow it down by defining another vector. I assume it needs to be the rotation of the plane or something.

But the basic formula is described in Unity’s weird scripting manual page on it:
http://docs.unity3d.com/Manual/ComputingNormalPerpendicularVector.html

I think it would be something like:
Vector3 tangent = Vector3.Cross(normal, vectorFromPlaneRotation);

But look up Orthogonal Vector to understand it more. And to double check. I could be wrong.
Sorry for the incomplete answer.