I am trying to create a basic 2D spaceship object as part of learning unity. The object should be able to move forward in the direction it is facing and rotate using the WASD keys.
My script currently reads as follows:
public float thrust = 1.0f;
void Update () {
//Retrieve axis information
float inputX = Input.GetAxis("Horizontal")* thrust * Time.deltaTime;;
float inputY = Input.GetAxis("Vertical") * thrust * Time.deltaTime;
//print (inputY);
rigidbody2D.AddTorque(-inputX);
rigidbody2D.AddForce(transform.forward * inputY);
}
Rotation works correctly, however i can see no change either on screen or in the inspector for Translation. As you can see I have checked that the input from the keys is returning a value via printing to console and it is working correctly.
Thanks in advance.