Right now I am building a game that is a simplified version of clash royal, with fighting units on lanes. The game is nearly finished, but there is one problem I cant fix.
So I made a button out of a sprite. When you click on it, a unit will spawn. Each unit has the pathfinding behavior. With a unit it will create a turret, that is pinned on the unit. Also when they spawn, the pathfinding is set to the enemy base. On start of the layout each turret gets the enemy units as targets. To let them fight, I set it: When the turret has the target aquired, it will set the pathfinding max speed to 0. After the enemy unit is destroyed the speed is set back to its normal speed.
Now the problem is, when I send out two units of the same type on the same lane and the first unit reaches a enemy unit it stops and they are fighting, but the second unit, that is behind also stops. The second unit should go on until it reaches the enemy too. When I send out the same unit during a fight it will automatically join the fight.
How can I make it that the second Unit will go on and dont stop until it reaches the enemy?