For clarification, here is how it is all organized so far: Family: Spaceship Multiple Turrets with different Fire Rates. my bad, i was thinking your doing some tower defense type of thing. edited: i misunderstood, you have 120 spaceship using the same turret to shoot. unless you wan't to have a turret for long range and one for close encounter. as the games i played so far, they all shoot when have enemies in proximity.
![turretz game multiple same turrets turretz game multiple same turrets](https://vignette.wikia.nocookie.net/military/images/a/a6/AMX-50.jpg)
However im not sure why you want the turrets to have different targets.
TURRETZ GAME MULTIPLE SAME TURRETS CODE
The other way around turret behavior is using distance(x1,y1,x2,y2) and compare for each spacecraft set angle towards it etc manually code the turret behavior with events basically. This should fix your problem while still keeping the behaviors and family's to some extent. (the spacecraft don't need to be taken out of the family, but you would need for the turret to get as target the spacecraft name, and not the family of which the spacecraft is part of.) but you need to separate the turrets not having them in the same family.Īlso would require your spacecrafts to be different sprite objects, and not different animations on the same sprite. The more tedious and simplest way for you i think right now is to separate the turrets from the turret family and have individual targets and turrets with their own turret behavior. How can I work around this? Or is there a way to do it without turrets?
![turretz game multiple same turrets turretz game multiple same turrets](https://live.staticflickr.com/3034/2959906347_502f3f0d9e.jpg)
![turretz game multiple same turrets turretz game multiple same turrets](https://i.pinimg.com/originals/cc/e7/db/cce7dba06615435e7cf90de516398b81.jpg)
Now the problem I'm facing is that if I have two different Turrets enabled on the same ship, with different Fire Rates, all of them are going to shoot using the first enabled turret's fire rate in the behavior list.