Jump to content

[SOLVED] Pathfinding Example


photo

Recommended Posts

Hello Hakan,

 

Could you please upload your navmesh? I had a look at your code and have some suggestions:

 

1) It's not so useful to start update_scene thread in every frame so it's nice if you remove this or move to init function;

2) Try to set exclude obstacles to path route because your car is an obstacle and you're trying to calc path from inside that obstacle so it might not work as your expected;

3) It's better to use relative paths instead of absolute when you want to include header files.

  • Like 1
Link to comment

Hi Hakan,

 

Thanks for the files!

 

Good news! I've managed to get this working well. The main problem was that your Navigation node wasn't prepared properly as it has to have a little bit more height so the car and the coin will be inside that mesh volume. Another problem was with your path checking code during set_availability call, it tried to get path route instantly which might not be ready right after the call.

 

Also, I cleaned your code a little bit. Please find modified code in the attachment.

 

P.S. I tried it to our latest engine build so if it won't work with your version of unigine that means that I forgot to change some stuff back. So please tell me about that it you'll encounter any problems.

Point_Usage.zip

  • Like 1
Link to comment
×
×
  • Create New...