Detecting obstacle while moving along path

Get help using Construct 2

Post » Wed Oct 02, 2013 9:23 pm

Hello!

Thought I would update my problem here. I have come across an issue that I'm struggling to resolve.
Upon pressing a switch, an obstacle tile moves well out of the way.
Upon releasing a switch, an obstacle tile moves back to its original spot.
If I select a spot as destination and start pathfinding, upon releasing the switch that I'm pressing, the obstacle returns to its original spot but the player will walk through it. I've not been able to solve this with regenerate obstacle map. Has anyone come across an issue like this or does anyone have a quick way of solving it?
If it's not entirely clear what I want is for the player to detect that the obstacle tile has returned to its original spot and therefore block the player as he moves into it.

Thanks!plinkie2013-10-02 21:24:35
B
45
S
15
G
73
Posts: 2,008
Reputation: 43,398

Post » Wed Oct 02, 2013 11:30 pm

You need to call 'find path' again after regenerating the obstacle map for any objects that are already moving. And don't forget that the obstacle map won't be updated until the next tick so you need to wait a bit before calling 'find path'.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Wed Oct 02, 2013 11:43 pm

Ah of course! Thanks for the help
B
45
S
15
G
73
Posts: 2,008
Reputation: 43,398


Return to How do I....?

Who is online

Users browsing this forum: part12studios and 9 guests