How to rotate and move gameobject at same time on key press

I want to rotate and move gameobject at same time on keypress but it only do one thing . In my code it only move the game object , I want to rotate it as well…

if (Input.GetKey(KeyCode.D))
{

 transform.Rotate(0,0,-( speed * Time.deltaTime));
 transform.Translate (Vector3(-0.5,0,0) * Time.deltaTime*speed);  

}

Plz help

Nothing wrong with that. Works for me; however I tried it on an object with no rigidbody.

I’m thinking, as its a rotation around z it’s not working for you for one of two reasons.

  1. You have a rigidbody on the object and the gravity is preventing z-rotation.

  2. You have frozen rotation

14831-rb.jpg