I'm making a tower defense game and i'm using the turret behavior for it. It works just fine, but I want to add some more to it.
There's going to be some buildings that the player may build towers nearby to destroy, but I want the towers to give priority to walking enemies, so they will only shoot the buildings if there is no walking enemy in range
<img src="http://i54.tinypic.com/155kuoj.gif">
Black: building that is being shot by blue turret
Blue: will switch targets if red walks in range
Red: is higher priority than black
This is the "get target" event
<img src="http://i56.tinypic.com/30djiax.gif">
Both walking enemy and building are in the "Enemy" family
"Items" family is the turret family
I tryed giving each enemy a "priority" variable, and tell turret to "pick Enemy with highest 'priority'", but that did nothing. It just locks on the building untill it's destroyed