How do I make an actor target another

paulitsmepaulitsme Member Posts: 109
edited November -1 in Working with GS (Mac)
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?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Are you trying to make it appear to go over the heads of closer actors and hit one that appears to be farther away?
  • paulitsmepaulitsme Member Posts: 109
    Thanks for the reply

    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 ?
Sign In or Register to comment.