Pathfinding Issue

0 favourites
  • 2 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hello,

    I'm working up a game built off of the pathfinding demo. When creating a new level I duplicate level 1 and work up a new map, enemies, etc. I have a text object on Layout 1 that once clicked takes the player to the next level. The pathfinding breaks when the new level is loaded.

    I've tested on the pathfinding demo itself and the same problem occurs. I simply duplicated Layout 1 to create Layout 2 and changed nothing else. I then placed a text object on layout 1 so that when clicked it loads layout 2. When layout 2 loads the pathfinding is broken.

    If I load my level 2 directly it runs fine. If I tweak my code to load level 2 directly from the welcome screen it works fine also. The pathfinding only breaks if a previous level with pathfinding has been loaded.

    Any ideas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK, after much searching and little sleep I think I'm getting close. It looks like I need to implement the "Regenerate Obstacle Map" action since I have a second level with new paths and obstacles, correct? I'm just not sure quite how to do that.

    If, like in my example above, I were to duplicate Layout 1 of the pathfinding demo that comes with Construct 2 and create "Layout 2", where would I need to add the Regenerate Obstacle Map action?

    Of course I could be way off base. From what I've been able to find the regenerate obstacle map is needed when a new obstacle is placed on the playing field. My second level does have a new obstacle (wall) layout but it's already set and in place when the player enters the level. The player does not add any new obstacles themselves.

    *UPDATE* No luck. Regenerate obstacle map does not appear to be the solution. Back to square 1. Testing on the Turret Defense template that comes with Construct yields no successful results.

    I'm at the mercy of the fine gentlemen and ladies of the forum to help show me the light.

    Thanks in advance for any help.

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