Hello everyone. I have an enemy who moves back and forth and when the player is within range, the enemy stops, looks at the Player, and begins to shoot. It's very simple, but the shooting is off. I can't figure what I did wrong, but when the enemy shoots, he shoots towards the enemy, but at a 45 degree angle, so not at him really, just in his direction. If I go onto the other side of the enemy (it's a 2d sidescroller), then the enemy doesn't even shoot towards me on the other side. He just keeps shooting along the previous path. The enemy turns to face the Player if the players in range.
Here's where I find out the direction:
and here's my shoot function that gets called:
Thank you for any help you guys can give.