Pathfinding with moving targets

0 favourites
  • 9 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Is there any examples? When I try it, AI only moves to the position the target was first at but it doesnt follow the target

  • I am surprised that the AI moves at all. Normally, the path is created in one tick, and in the next, the AI moves along the path. If the path creation event is true every tick, the AI will not move but will constantly create a new path. Try it like this:

  • It worked thanks alot!

    Is random pathfinding possible?? Like for example

    NPC has no targe/pathfound it just walks around randomly

  • Copy the event, invert "Has line of sight to player" by right clicking, then change your actions to how you would like it to wander when it doesn't have line of sight.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can send the NPC to a random position when it is not fighting. To prevent that it wanders the hole map, you can define the startposition with instance variables, for example:

    .

  • You can send the NPC to a random position when it is not fighting. To prevent that it wanders the hole map, you can define the startposition with instance variables, for example:

    .

    Ok So I tried this

    But they dont wander, they just stand there.

    Can this method be used with a family?

    Should Start.X and Start.Y be number or text?

    btw thanks for your help!!!

  • Your code is different from what i suggested. Make sure the enemies 'Status' is "Patrol" when you try to start the timer (Use the debugger if you are not sure). It works with families too and you need the 'Move along path' action only once at after all 'Find actions'. StartX/Y are numbers.

  • Your code is different from what i suggested. Make sure the enemies 'Status' is "Patrol" when you try to start the timer (Use the debugger if you are not sure). It works with families too and you need the 'Move along path' action only once at after all 'Find actions'. StartX/Y are numbers.

    Wow thx it works!! I wasnt paying attention lol was tired!! Thx A lot!!!

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