How do I continue the pathfinding of one object?

0 favourites
  • 2 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

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