How do I Multiple Enemies to Pathfind to Player w/o...

  • How do i get multiple enemies to pathfind to player without them combining and looking like one enemy. I think its in the " Every X seconds" that's making them path find in the same place to make them look like one? This is mostly when running away from the enemy.

    Heres how i got the enemy to Pathfind to the Player. The enemy is made of 2 objects. Top is Turret. Bottom is Pathfinder.

  • Hey JasonS,

    One possible approach might be to separate the problem of path finding from the problem of overlap prevention.

    Instead of having the Soldier be the object doing the path finding, make your current path finding object invisible, and make a new soldier object to follow the path finding object. Then give that Follower object the physics behavior, with a constant force pulling it towards its personal Pathfinder. By default, Physics objects won't overlap each other, and will instead slide past each other, or bunch up like gumballs in a jar.

    But what if there's a physics traffic jam, and one of the physics Followers can't keep up with its Pathfinder object? After all, if a Pathfinder goes around a corner while the Follower is stuck, even if the Follower later gets un-stuck the Follower may not be able to reach the Pathfinder by moving straight at it, via a physics force. We need to make sure a Follower never gets left behind.

    Basically each Pathfinder should be a mini Dr. Alan Grant. :)

    To prevent Followers from getting left behind, you can pause the Pathfinder if it gets too far from the Follower. "Too far" in this case might mean 1 or 2 soldier widths. Ideally the soldier (Follower) will nearly always be just behind, and almost touching its Pathfinder.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah, that gives me some other ideas for things. But i really cant have a enemy waiting up for a follower. i need the enemy to be on the players arse. but i never thought of a invisable follower. That could be usefull to me later on.

  • fisholith If a simple Capx files exists for this, that would be awesome! I can't seem to figure this out.

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