2
\$\begingroup\$

Please watch this short video. http://screencast.com/t/vw2a5FdOOT It shows the problem.

It's using the build in Unity navigation and followed the guide to build the demo in the video.

Everytime I add a new obstacle than all agends pauses (hiccups) for a short time. I think this is because they have to recalculate a new path. How to make this recalculation in a background thread? I want to make a mace tower defense.

Thank you for reading an watching!

\$\endgroup\$
2
  • \$\begingroup\$ Out of curiosity: does Unity's navmesh even allow dynamic obstacles or runtime updating? Or is that from a plugin in the asset store? Anyway, if you are asking how to make the updating be calculated in a different CPU thread than the main game's, that's not trivial at all (you would have to read a lot first on multi-threading). And honestly, I'm not sure that solves the problem because it doesn't make sense to let characters move before path updating is completed (they could end up inside the new obstacle). \$\endgroup\$
    – MAnd
    Commented Nov 29, 2015 at 21:26
  • \$\begingroup\$ Yes unity supports runtime obstacles. But it gets these hiccups if there are many agends \$\endgroup\$
    – zeiteisen
    Commented Nov 29, 2015 at 21:28

1 Answer 1

1
\$\begingroup\$

Built-in navigation has lagging problems (more than lagging, actually), that's a known issue. I suggest you to use a better navigation solution.

This is, for example, pretty fast: http://arongranberg.com/astar/

\$\endgroup\$
2
  • \$\begingroup\$ I tried arongranbergs solution but it has a different problem. See gamedev.stackexchange.com/questions/112167/… \$\endgroup\$
    – zeiteisen
    Commented Nov 29, 2015 at 21:39
  • \$\begingroup\$ @zeiteisen believe me, it is still better than built-in one. \$\endgroup\$ Commented Nov 29, 2015 at 22:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .