Face weapon in the right direction that the player is facing!
I am working on a basic attack in which the player will use a weapon to attack the bad guys. It uses the same attack as a sword except the weapon is not actually a sword but it's an electric shock of lightning. However, I'm trying to face the weapon in the right direction the player is facing. Everytime I face to the left the weapon always keeps facing to the right and doesn't flip horizontally whenever I press a key to attack. I've followed most of the steps I found on other posts here on the forums but it doesn't seem to be working for me. I've already created a boolean Game attribute and rules to the player that goes like this:
Rule: If "A" receives a key press...
Change attribute: game.BasicWeapon To: True
Otherwise... Change attribute: game.BasicWeapon To: False
Constrain Attribute: game.PlayerX To: self.PositionX
Constrain Attribute: game.PlayerY To: self.PositionY
Here are rules made to the weapon:
Rule: If game.BasicWeapon is True...
Constrain attribute: self.positionX To: game.PlayerX
Constrain attribute: self.positionY To: game.PlayerY
Otherwise... self.positionY To: -100
The weapon is a separate actor which will be an arm shooting out the electric shock of lightning from his finger and I tried to constrain it to my player. Here's how it looks like: https://postimg.org/image/i4c3vbgsn/