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?