This is kinda complex so I'll be as specific as I can.
My game is in "CONTRA" style.
The character is divided in 3 sprites: legs, upper half, and shooting animations.
the legs are the main part and are separated form the rest so i don't have trouble with the "firing/walking" animation.
the upperhalf is pinned to the legs and when you aim that's the part that switches anims so it aims correctly at every direction.
and the shooting is just the frames of the upper part while the guy shoots, also pinned to the legs. when these appear, the other upper half goes invisible, so it looks like both are the same sprite and it doesn't interfere with the aiming. When the guy is not shooting, this sprite goes to a "null" animation that has no frames in it, an invisible animation.
We're Ok so far.
Now I'm creating a machinegun alternate mode.
I've made it this way:
When "Z" key is down, the shooting sprite goes to the normal shooting. when it ends, it goes to the null anim, and if when the null anim is over the key is still down it goes again to the shooting.
so it creates a loop that stops once you've released the key.
the thing is working perfectly, but the problem is that the bullets are coming from the imagepoint of the NULL anim, not the SHOOTING anim. So, it is like if the bullets are being created 1 tick before it should and are interpreting the imagepoints of the previous anim. This is weird since it's set so the bullet is created once the shooting anim starts, so, there's no way the bullet is created before.
It works fine in the first shoot of the bunch, but when it gets in the loop is where the problem starts.
How can I solve this?