How do I "unstick" stuck pathfinding objects?

Get help using Construct 2

Post » Thu Jun 29, 2017 3:52 am

Hi, I've got a strange problem and I'm not sure what holes in my logic are causing it. Basically, my enemies are set to pathfind to the player when they are in range, stopping and setting a new path every second or so or when they stop. However, if an enemy cannot find a path when that time arrives, it does not try again when the timer expires, instead this happens:

Image

and it stays this way. After this, they stand still permanently. They still detect the player and the relevant "chase the player" variables still function, but the pathfinding itself does not.

I have a hunch this is happening because the enemies are solid or obstacles of each others' (so that they don't overlap), because it works just fine with I disable those behaviors. Thus, they try to path around each other to the player but cannot because other enemies are in the way, so they stop and then for some reason don't start again. Here is a big ol' image with all of the code for the enemy:

Image

Any ideas as to why it's happening and/or how I can force them to recalculate? I thought I was already doing that with line 163 but perhaps not.
Last edited by CJacobsSA on Thu Jun 29, 2017 4:38 am, edited 5 times in total.
B
18
S
9
Posts: 103
Reputation: 1,817

Post » Thu Jun 29, 2017 3:55 am

Quick double post to say that if there is another method of making them not overlap that doesn't involve the solid behavior, which would sidestep this problem, I will take that as an answer too!
B
18
S
9
Posts: 103
Reputation: 1,817


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests