constant movement while looking another way

How can I make mouse look independant of movement?

This is to replicate battlestar galactica viper dogfights when vipers flip over and shoot behind them but continue their forward momentum.

function FixedUpdate () 
{ 
   MousePosition = Input.mousePosition; 
   MousePosition.x = (Screen.height/2) - Input.mousePosition.y; 
   MousePosition.y = -(Screen.width/2) + Input.mousePosition.x; 
   transform.Rotate(MousePosition * Time.deltaTime * rSpeed, Space.Self); 
}


if(("Thrust")){ 
   rigidbody.velocity = transform.forward * Time.deltaTime * flyingSpeed;
}

Can someone help me modify my script so the ship only changes direction when a key is pressed otherwise has free mouse look?

This line:

rigidbody.velocity = transform.forward * Time.deltaTime * flyingSpeed;

Moves the object along its current forward direction vector. If you want the direction of motion to be independent of the object’s orientation, you’ll need to use something other than ‘transform.forward’ here.

Since I don’t know how you want the control scheme for linear motion to work, I can’t really be any more specific than that.

I’m assuming that

if ("Thrust") {

should really be

if (thrust) {

(ie, without the quotes) where the boolean “thrust” is set/unset with a keypress/axis movement.

If that’s correct, then fixing up the conditional should do the trick.