issue when changing velocity according to rotation

I’ve been through all the questions on changing velocity relative to rotation and am still stuck. Hopefully this is just some noob thing I’m missing.

This is what’s going on: If I face down the Z axis, everything works fine, but if I face down the X axis, all movement is inverted.
Here is my code:

	float yRot = mouseLook.curYRotation;
		_transform.rotation = Quaternion.Euler (0f,yRot,0f);
		_rigidbody.velocity = new Vector3 (Input.GetAxis ("Horizontal") * speed, _rigidbody.velocity.y, Input.GetAxis ("Vertical") * speed);
		_rigidbody.velocity = transform.InverseTransformDirection (_rigidbody.velocity);

help much appreciated

edit: ok, I figured it out :confused: just had to use TransformDirection instead of InverseTransformDirection

Not sure exactly what movement you are looking for, however if the movement if inverted then you should invert the code.
swap the horizontal and vertical axis in the 3rd line