I have ran into an issue when my character is facing straight downwards in a 2D game.
As seen below this is how he should appear, weapon in his right hand and bullets originating from firepoint, marked with red star (a sprite rendered to make it more clear)
When aiming straight down Z rotation changes to 0 and X rotation to -180 making the character mirrored.
I tried fixing this issue with a script that simply flips the character correctly when its Z rotation is a certain value and it works, the character no longer looks mirrored.
if (zAngle == 180f)
{
transform.Rotate(180,0,180);
}
However, the red star on the tip of the weapon is a sprite rendered on a child gameobject to the player called firepoint which is used as a location to instantiate bullets. When I shoot while facing down, even tho the weapon is placed in the characters right arm and the red star (the firepoint), the bullets originates from where the firepoint would be if the weapon was in the characters left arm. Like this:
I have an output of the position.x and position.y of the firepoint gameobject and it changes more than it should when looking straight down, making it not being in the same location as the spriterenderer attached to said gameobject. Graphic wise it is correct but the position of the gameobject is not where it is presented graphicly. Any ideas or suggestions is much appreciated!