Moving Parts On A Tank

I need help with making the rotating parts of a tank (the part with the gun attached) i have the body and the gun in two separate mesh so they can have different movements but i cant figure out how to set the gun to rotate on top of the body of the tank so they move together without them separating when pointing in different directions.

select the “the part with the gun attached” and add these Logic bricks:
Always Sensor -> AND -> Motion Actuator - Simple Motion - Z Rot - 0,10
It should work, I hope…anyway your question was too vague!

I was meaning to mount the gun to the body so that it moves freely but is still attached to the body. I already have keys set to rotate the gun and move the rest of the tank around but i cannot connect the two parts together so that when i drive the tank
the gun can move with it but still be able to point the gun in different directions. I hope that this was better.

Select the “gun” and then the “body” and do Ctrl-P keys!

Thanks that done it, I had to mess with it to get everything centered but it worked.
Much Thanks.