C#C
C#3y ago
NAS24

❔ Need help trying to make 2D car move from above

// {
        if (Input.GetKeyDown(KeyCode.W) == true)
        {
            myRigidbody.velocity = Vector2.up * 1;
        }
        if (Input.GetKeyUp(KeyCode.W) == true)
        {
            myRigidbody.velocity = Vector2.zero;
        }
        if (Input.GetKeyDown(KeyCode.A) == true)
        {
            myRigidbody.transform.Rotate(new Vector3(0, 0, 90));
        }
    }


With this code I can only move it up and rotate left 90 degrees. I want to be able of rotating it 90 degrees left and then when I press W it keeps moving in the left direction. Some kind of forward code
Was this page helpful?