How do I continue the pathfinding of one object?

Get help using Construct 2

Post » Fri Jan 19, 2018 3:30 pm

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?
Posts: 1
Reputation: 177

Post » Fri Jan 19, 2018 4:54 pm

Hey Chieftromlitz,

can't say for sure if we dont know your code but usually a 'for each' loop solves the problem: for each unit have a target -> stop and attack
Posts: 94
Reputation: 1,471

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests