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.
↧