Animation rotation wrong object

I am making a 2D space shooter, and I am trying to animate the guns on the boss ship. It has 6 identical guns, only with different positions and/or rotations. I have created an animation to make the guns rotate in certain patterns, but it doesn’t act correctly when I test it in the game.

Results:

  • Guns 1-4 animate properly.
  • Gun 5 doesn’t move at all & has a rotation of 0. (Not even counting the animation, the original rotation of Gun 5 is set to 180.)
  • Gun 6 plays the animation for Gun 5.

I’ve tried deleting the objects and creating new ones (from scratch, NOT duplicates), together with creating an entirely new animation, but I get the same result.

What could be causing this problem, and how do I fix it?

It turns out that the cause of the problem was deleting other objects that belonged to the same parent.

Before the guns activate, there are other parts of the boss that must be destroyed. Once they were destroyed, I was simply deleting them, but this caused a trickle-down effect of rotation values. I’ve changed my code to simply deactivate the other parts instead of deleting them, and now everything works fine.