when my gameobject rotates and moves forward, it moves left and then right in leke a swaying motion instead of moving forward and rotating. here is the code:
public float rotationspeed;
public float speed;
// Start is called before the first frame update
// Update is called once per frame
void Update()
{
transform.Rotate(0, 0, 50 * rotationspeed * Time.deltaTime);
transform.Translate(Vector2.right * speed * Time.deltaTime);
}`