How do I make an actor target another
paulitsme
Member Posts: 109
Hi,
I have a turret in my game that shoots when another actor is within a certain range.
How do I make the bullets go towards the actor that's in range and not other actors when I have many of the same type of actor on the screen?
I have a turret in my game that shoots when another actor is within a certain range.
How do I make the bullets go towards the actor that's in range and not other actors when I have many of the same type of actor on the screen?
Comments
I just want it to shoot at the closest actor to the turret. Its ok if a stray bullet hits something else.
I can get the gun to target one actor and shoot at it by constraining the enemys x and y coordinates and rotating the gun towards them. But that doesn't work when I have more than one of the enemy on the screen at the same time because they use the same attribute.
How do I get around this ?