Rigidbody2D component does not work as intended (Beginner)

Hello people!

Right now I’m working on a 2D game. In the game I have a player (parent) and a gun (child) which is supposed to rotate 360° around the player.
Both the player and the gun are controlled by a Rigidbody2D script.

Now the problem:

When i move the player im not able to move the gun, only when the Rigidbody component on the player(parent) is sleeping, the gun(child) rotation script (made with Rigidbody2D) is able to run.

Here’s a video: Rigidbody madness - YouTube

It seems like the to Rigidbody2D components connot run at the same time.
What can i do to fix this and if not, what can i do alternatively?
Infos:

  • player(parent) is a sprite with cirlcle colider 2D and rigidbody2D movement script + the rigidbody2D rotation script for the gun(child). This script for the gun references the rigidbody2D on the gun.
  • gun(child) is a empty with rigidbody2D

I hope youre are able to help me with this problem.
Thank you in advance.

Can you show us that part of code which handle rotating of gun? Why you have Rigidbody on gun GameObject?