How do I make correct pathfinding movement?

0 favourites
  • 2 posts
From the Asset Store
Pathfinding AI
$2 USD
80% off
Units do not overlap each other and use different ways if there are several free ways.
  • Basically what I am trying to do is have a sprite move to a position using pathfinding but I need it to move on a grid (the grid is made using a tilemap with the cell size for the pathfinding being the same as the tile size so no problems there). What is troubling me though is that upon clicking to move the sprite it doesn't move until I click once more eg I want to go a position I need to click twice for the object to find and start moving along the path. At first I thought it was the pathfinding that was a bit slow but afteresting it by double clicking with different time delays between the clicks that was not the case aka if I clicked fast then the object moved as soon as the second click took place but if I clicked slow then the object wouldn't move until I clicked the second time. And it wasn't the first time either. Every time I want the object to move I have to click twice.

    On top of that I noticed that the pthfinding doesn't find the fastest route to the destination. Since I want the object to move in a grid I set the Diagonal movement to False which works as intended but when the object moves to a new position it just follows a straight path followed by a 90 degree turn and then another straight path to the target area (no obstacles to move around in the layout). The problem is that instead of following the closest path aka a pseudo-diagonal movement made up of multiple 90 degree turns it follows a much bigger path.

    Is there an option to change these or do I have to code that my self?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try a cell size = tilemap celll size / 2 & cellborder tilemap celll size / 3 to 4.

    The nodes are on the grid, an accurate grid = more accurate paths.

    Other plugins, specific for tilemaps :

    But you will have to combine those with a method to move from node to node.

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