Pathfinding Ends Early

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • When I use the pathfinding feature, it always ends a little early. For example, if I just set the position of the sprite to (140, 20) then the 20x20 sprite moves directly over the other 20x20 sprite at that location. Perfect. If however I use pathfinding to do this, the sprite stops moving before he completely arrives. I can't figure out why, or how to fix this.

    Here is my file: dropbox.com/s/cdrg3c1szicknoh/testing.capx

    Instructions: move the cursor icon with the wasd. Move it over the red and beige sprite and press Q to select him. If you press R he will teleport to the correct location, directly over one of the grey squares near the top. If however you press E, he will try and make his way to that same spot through pathfinding.

    Thanks in advance for any help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, I have been working on this for a couple of days now and I have come to a few conclusions. The main one is that I must use sprites of 32x32 size on a grid of 32x32 if I want them to align properly. I was using sprites and a grid of 20x20, but I guess the pathfinding wasn't finding that and I couldn't figure out how to change it.

    If anyone knows how to change the size of the pathfinding grid let me know here, thanks.

  • Change the Cell size, it's the first parameter of the behaviour.

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