Pathfinding doesn't work

0 favourites
  • 5 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • I have a tower defence game, where there are 2 levels.

    Each level is a layout and an event sheet.

    The monsters follow the road with pathfinding behavior and solid objects around the road.

    If I launch any of these 2 levels directly from Construct 2, the creeps go the road nicely.

    But if I complete level 1 and go to level 2 - the creeps ignore solid objects and just go straight ahead.

    What am I doing wrong? =(

  • Could you post the capx? It's probably something in the events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • maybe a capx is needed, but from the top of my head:

    every obstacle you want needs to A) have the solid behavior, or B) be manually added to the custom obstacles for the object with path finding. (in any case select the proper obstacle type in the behavior properties)

    Also, obstacles are not updated unless you "regenerate obstacle map".

    To avoid over saturation, I recommend regenerating the obstacle map only when needed. Like in the same event that finds the path, though you need to make sure the "regenerate obstacle map" action is above the "find path" action.

    Hopefully is a simple problem like this ^^

  • This video helped me as far as making a check list...

    Subscribe to Construct videos now
  • Thanks for the replies.

    The point is - when you make several (2, for example) layouts with pathfinding behaviors, they stop working correctly after you pass between them.

    I solved the problem with removing of pathfinding and adding a move-to-target and a function to control it.

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