path finding problem

0 favourites
  • 3 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • Hi. I wanted to know how to make an object path find another object that has the path finding behavior applied to it too. the two objects has the path finding behavior applied but I want one of them to follow the other. The first object will find its way to door or something and it will be chased by another object. when I apply the path finding behavior to the enemy object it just move in the wrong direction and don't follow the main character. I used the "rotate towards position" but this makes the enemy character move through obstacles, and that's not what I wanted.

    So how can I fix this?

  • Not sure how you can make pathfinding objects collide with solids, but making one follow the other is simple.

    [attachment=0:3hca7n38][/attachment:3hca7n38]

    Not sure what issue you're having but this seems to work.

    You might want to make sure the enemy object has obstacles: the default is solids, but anything other than that e.g. physics needs to be manually set at the beginning of the layout.

    The other thing is that rotating towards position would indeed rotate towards the player, regardless of the fact there's a wall between them. Thus when the object - which has no collisions - tries to move, even the opposite way, it will move straight through.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks a lot. I will try that

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