# Simple 2.5D flight movement

I'm building a simple 2.5D Dogfighting game, kinda similar like this one: https://gfycat.com/PleasantDeterminedArcherfish for the moment my movement works like this:

    if (Input.GetKey("left"))
{
transform.Rotate(0, 0, rotation);
}

if (Input.GetKey("right"))
{
transform.Rotate(0, 0, -rotation);
}

if (Input.GetKey("up"))
{
if (speed <= maxspeed)
speed += speedIncrease;
if (gravity > 0)
gravity -= speedIncrease;
}

if (Input.GetKey("down"))
{
if (speed > 0f)
speed -= speedIncrease;

if (speed <= 0f)
speed = 0;

if (gravity < 1.0f)
gravity += speedIncrease;
}

transform.Translate((Vector3.down * gravity), Space.World); //This is for the fake gravity
transform.Translate(new Vector3(0, 1 * speed, 0)); //This applies the forward speed


I tried to create the gravity by myself, so that I would be able to lower the gravity, at higher speeds, so that I can achieve an "uplift" effect, like in reality. But now I wanted to let my model face the movement direction and all solutions, I found to solve this problem use the rigidbody.velocity, which is zero in my case. Is there another case to solve this problem? Or maybe even a better solution to achieve a similar movement like in the gif than mine? Maybe adding force instead of Translate?

• Possible duplicate of A simple flight simulator – Philipp Apr 4 '16 at 13:39
• I guess not, since my main question is how to achieve "face the direction of movement" without 'rigibody.velocity' – TobiasW Apr 4 '16 at 13:44
• Then you might want to edit the last three sentences of your question, because they give the impression you are open to any suggestions how this problem could be solved. – Philipp Apr 4 '16 at 15:10
• Tell me if I'm wrong, but from your code I imagine that your problem is that your "ship" si rotating correctly but it actually only goes up or down (instead of moving accordingly to its rotation). Am I correct? – lvictorino Apr 4 '16 at 17:03
• No it moves correctly, since it's always moving "local forward", there is just the point that the "nose" of the plane does not fall down, when the plane is losing speed and drops down. – TobiasW Apr 5 '16 at 6:07

Mouse_X = MousePosition.X - (1023 / 2)