mech2 (yes another one sorry)

 From:  PaQ
2111.18 
Cool :)

I would probably attach (parent) the gun to the cockpit body, so you have more freedom when animating the legs and keep the gun more stable.
You'll be also able to the rotate the cockpit and the gun around a vertically axe (heading) and keep the legs walking straight ahead.

That would be more effective on the battlefield ;)