0 Favourites

Detecting obstacle while moving along path

  • 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.


  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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'.

  • Ah of course! Thanks for the help <img src="smileys/smiley20.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
564 105,179
rexrainbow's avatar
Unread hot topic
0 Favourites
Path Movement Behavior
98 52,468
R0J0hound's avatar
Unread hot topic
0 Favourites
Time to move forward?
110 9,560
GG-Works's avatar