Hinge Joint moving about the y axis

Is there anyway to move about the Y axis when the object your trying to move is attached to a hinge joint ? This code just makes the object bounce around

function Update () 
{
    if (Input.GetKey("a") ) 
    {
        rigidbody.AddForce (Vector3.right * -10); 
    }
    if (Input.GetKey("d") ) 
    {
        rigidbody.AddForce (Vector3.right * 10); 
    }
    var h = Input.GetAxis("Vertical");
    if(h){
    transform.Translate(0,h, 0);
    }
}

I set up a tutorial on how to move hinge joints, it’s basically using a system of parenting to get it to move.