The turret sprite (which is rotating) should be invisible.
The animation sprite (with 32 frames) should be on top of the turret, and should not rotate.
The "a" in my formula is the angle of the turret sprite.
I understand what you mean with an invisible sprite to run with a turret and the cannon goes on top visible, I tried your method but the angle still didn't work, the frames were messed up, I did this:
+ System: For each Tank1_Arm
+ Tank1_ArmTurret: ArmUID = Tank1_Arm.UID
-> Tank1_Arm: Set animation frame to round(((Tank1_ArmTurret.Angle + 360) % 360) ÷ (360 ÷ 32)) % 32
it worked but there is always a frame late