How do change force when pressing1 key then pressing another at the same time.

Hey Guys

i want to simulate a simple thrust like effect for example (Lunar Land). i want to thrust up when pressing up arrow key then thrust left/right when pressing the appropriate arrow key but still whilst keeping up pressed.

 if (Input.GetKey(KeyCode.UpArrow))
        {
            thrust = (Vector3.up * thrustForce);
        }
        else if (Input.GetKey(KeyCode.LeftArrow))
        {
            thrust = (Vector3.left * thrustForce);
        }
        else if (Input.GetKey(KeyCode.RightArrow))
        {
            thrust = (Vector3.right * thrustForce);
        }
        else
        {
            thrust = (Vector3.zero);
        }        

this is what i started with, and then started to add multiple “IF” statements which still did not move right. basically below, when i press UP the object thrusts up OK, but will not move left\right until i let go of UP and press left\right again.

i know this is probably a simple code issue.

thrust = Vector3.Zero; //Start with zero

if (Input.GetKey(KeyCode.UpArrow))

It seesm thats it was usage of ElseIF and how i managed the thrust… The following works

{
    thrust += Vector3.up * thrustForce; //Add on up thrust
}
if (Input.GetKey(KeyCode.LeftArrow))
{
    thrust += Vector3.left * thrustForce; //Add on left thrust
}
if (Input.GetKey(KeyCode.RightArrow))
{
    thrust += Vector3.right * thrustForce; //Add on right thrust
}