Hi guys im currently trying to make a 2D shooter similar to something like Intrusion 2currently at the stage where i have a character and am trying to make it so he always aims at the mouses location. It works perfectly if the character faces right, but if i turn him around the arm faces is the exact opposite direction of the mouse.
I have tried what you have there and it still does the same as my code. It only looks at the mouse if the character is facing to the right, if i move the character left so he is facing the left hand side the arm looks at the exact opposite direction to where the mouse is. I assume its something to do with how unity mirrors sprites but i dont know how to fix it.
Yeah the body is part of one animation prefab and then the arm is separate from the rest to it can work on a swivel. At least that was what i was hoping for.
Does the character ever put the gun down? If not you could have just the one sprite & flip it or if you didn’t want it to look like he was switching arms to shoot create 2 sprites & just show the oNe that matches the direction he is shooting.
Good luck, & this should let you progress & test more stuff in your game. You can always go back later & try to get it working again with the swivel if you aren’t satisfied with how it looks.