How to have a turret track like in tower defence games?
So I am working on a turret defence game. I have where the turret rotates to game.attribute coordinates which are the enemy's coordinates. The enemies have self health attributes and there are bullets to shoot them. I have an actor called ''turret range'' which is supposed to be the turret's range. But here are my problems:
- Once the enemy is out of range, and the turret stops firing, everything is good. But, once the enemy reaches another turet range of another tower, all turrets start firing. I can't edit a self.attribute from another actor, thus I am stuck.
- The turret aims at the enemy farthest away, even if he is out of range.
Thanks for any help.
Here is my file: