how tank and barrel move and rotate

Hi I want to make tank game.But tank does not move and rotate.I wanted to move barrel of tank up and down.Then body of tank rotate and move.Please help me…

Look at this and Suscribe me !!!
public class Tank : MonoBehaviour
{
public Transform TankGun;
public float RotationSpeed;
float Yang;
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
    if (Input.GetKey(KeyCode.Q)) 
    {

        Yang -= Time.deltaTime * RotationSpeed;
    }
    if (Input.GetKey(KeyCode.E))
    {

        Yang += Time.deltaTime * RotationSpeed;
    }

    TankGun.rotation = Quaternion.Euler(new Vector3(TankGun.rotation.eulerAngles.x, Yang, TankGun.rotation.eulerAngles.z));
}

}