Sir_Skurpsalot Posted June 4, 2020 Share Posted June 4, 2020 Trying to learn to use navmesh and navpath, but I keep getting this error."No NavMesh polygon near visit point (105.3, 88.7, 513.094) of NavPath 21142"There are indeed blue navmesh polygons around it according to the editor.This is all that is needed to create a navpath from script right?[code2=BBCODE40_TORQUESCRIPT]%navPath1 = new NavPath(){ mesh = Nav; from = %demoAI.getPosition(); to = NavTest.getPosition(); };%navPath1.plan();[/code2] Quote Link to comment Share on other sites More sharing options...
Duion Posted June 4, 2020 Share Posted June 4, 2020 I get this sometimes as well, it is console spam, but I never bothered to create a navpath from script, the bots take it automatically, you just need to tell them where to go. Quote Link to comment Share on other sites More sharing options...
Sir_Skurpsalot Posted June 4, 2020 Author Share Posted June 4, 2020 If I try to tell my bot to just move directly to a location he just runs into a mountain and does not navigate.... is there something I am forgetting in order to get the bot to acknowledge the NavMesh? Because in the navigation editor if I spawn the test bot and click around at various points that one works great. Quote Link to comment Share on other sites More sharing options...
Sir_Skurpsalot Posted June 4, 2020 Author Share Posted June 4, 2020 Looked at the source code and figured it out.... you have to use setPathDestination() instead of setMoveDestination() and then he uses the navmesh and finds his way there. I guess the navPath object is pretty pointless. Quote Link to comment Share on other sites More sharing options...
Duion Posted June 4, 2020 Share Posted June 4, 2020 Yes, exactly setPathDestination vs setMoveDestination, I have a fallback in case my bots cannot find a navMesh, then they will automatically fall back to setMoveDestination, so they will work in any environment. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.