Turret getting messed up at multiple targets?

0 favourites
  • 4 posts
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • Howdy,

    Alright so I'm doing a tower defense game and obviously the turrets are the most important thing here. The problem is they kinda get messed up as soon as more than one enemy shows in the screen. I have it set so that the turrets acquire their targets every tick, (tried making them acquire at the beggining of layout but for some reason doesn't seem to work [they are spawned mid-game, if that affects]), but whenever a big group of enemies arrives the turret kinda gets confused at which enemy to attack and sometimes doesn't even shoot. I really need an answer for this, i've been trying so hard but nothing seems to fix this... Any help is really appreciated! <3

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello TheCreepy12,

    I did not try it, but i think this problem is similar to pathfinding. If you you want to find a path every tick and move along it, it will never move, cause it is always busy finding a path. You need one tick to acquire a target and the next tick must be used to shoot at it. Instead of "every tick" try it with "every 0.1 seconds", if you think that the targeting has to happen so often.

  • kriand

    "every 0.1 seconds" is not much better than every tick in this case. Before using "acquire target" you need to check that this turret does not have any targets already. Or simply use "Add object as target" once and the turret will acquire them automatically.

  • dop2000 thank you so much, that did really help, now they aren't getting stuck if i use the "Add object as target" <3

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)