Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

problems with navmesh pathfinding


SpaghettiCoding
 Share

Recommended Posts

Hi guys! I make rpg game and try to implement pathfinding by using navmesh plugin
(https://github.com/mikewesthad/navmesh/blob/master/tiled-navmesh-guide.md)

there is a nice tutorial and i follow it
but i have problem, no matter what coordinates i pass it always return null
(i build navmesh in Tiled)

there is a code:

        const objectLayer = this.tilemap.getObjectLayer("navmesh");
        console.log(objectLayer);
        const navMesh = this.navMeshPlugin.buildMeshFromTiled("mesh"objectLayer5);
        console.log(navMesh);
        const path = navMesh.findPath({ x:1500y: 2500 }, { x: 1600y: 2600 });
        console.log(path);


that what i have in console:

image.thumb.png.e247246be778cac905522edb5342f08e.png

 i tried to pass different coordinates and find path to mouse click. it always return null.   

if i add methods for visially debugging navmesh plugin it game looks like:

image.png.ff846f806b86e703b885c43207320754.png

 

Has anyone encountered similar problems?
This plugin has clear tutorial and i'm soo confusing that it doest'n work for me.

I appreciate any guess. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...