Hey all this is my first time on the forums so dont be too harsh on me.
I’m making a simple plane combat “Metal Storm-esque” game. Im having some trouble getting the player to rotate 10 degrees when i press the right arrow key and rotate -10 degrees when i press the left one and then normalising when i release. This is what i have so far
public class PlayerMovement : MonoBehaviour {
public float playerSpeed = 3f;
// Update is called once per frame
void Update () {
Vector3 input = new Vector3 (Input.GetAxis("Horizontal"),Input.GetAxis("Vertical"),1);
transform.Translate(input * playerSpeed * Time.deltaTime);
}
}
I would also appreciate if you had any other ways to optimise my code,
Tiatang