How do I change mirrored with pathfinding?

0 favourites
  • 3 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Hi. I'm using pathfinding behavior to move my character. I want my character to be looking on the left (be mirrored) when he is moving to the left and looking on the right when moving right. Seems easy: I just need to know where is his next node he is moving to located and if it's X position is higher than my characer - set not mirrored, if it's lower - set mirrored.

    However, there is a problem. When moving to the left - he is looking to the left always. But when he's looking on the right - he first looks to the right but then right when he's near his last node (without an obvious reason) he starts looking left, then right again (all while looking right).

    That's headscratching. I've thought that maybe pathfinding thinks that it reached it's final node too soon, so I've tried updating mirrored not every tick, but on reaching next node. There is no "on node reach" pathfinding condition, so I had to make 2 new variables: one will hold the information of current node, the other one will change when the node will be reached.

    But that did not help as well... Anyone have any suggestions? I can't seem to find any tutorial where pathfinding is being ised in isometric perspective (instead of top-down where character do rotates with pathfinding). Thanks!

  • Here is a video, showing the sudden mirrored changing error I have:

    youtube.com/watch

    Subscribe to Construct videos now
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • SOLVED. Here is the solution (use angles instead of next pathfinding nod position):

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