I am new to Unity and c# and have came from vb.net console programs.
I am trying to create a game similar to asteroids in terms of player movement in unity using the 2d mode, from a top down perspective. My player controlled character has a 2d rigidbody and i would like to use the “w” and “s” keys for forward/reverse thrusters.
This is the code i have created for forwards thrusters:
void FixedUpdate () {
if (Input.GetKey () = ("up")) //test user input
this.gameObject.rigidbody2D.AddForce (Vector2.up * 10f); //Increase player velocity
}
Any help on how to make it work would be much appreciated.
Thanks, aljowen