Hi i’m using a* pro in combination with the playmaker bindings… but I have the issue that I pool my AI gameobjects. Meaning if they die, I deactivate them and return them to a pool. But once I reactivate them, they sometimes go awol, first beelining to some other position or node, before resuming normal behavior…
I’ve been racking my brain for weeks to find a workaround , but to no avail… Anybody have a clue what might be causing this?
Hi
Depends on what script you are using.
I do not think the PlayMaker bindings has any support for this, you would have to write a script to clear the current path on the movement script, then it will work.
Thank you, I’ve got a seperate recycle path script/binding. which was altered to do path.reset (if i’m correct)… I’ve made a check that if the object is following for the first time after a reset, that it recycles. This does clear it up some times, other times, it will seemingly make a new path with the same error…
But if the recycle or reset should fix it, i’d better try and work that into the code better than currently… I think my limited coding skills should be able to handle this,
thanks again, here’s a video of the game i’m making, your a* is otherwise fantasticly easy and quick to setup… and the nodal pathfinding (pointgraph) is just super snappy on mobile.
Hi
You should not all path.reset, that’s an internal method.
If you are using one of the included movement scripts (AIPath, AIFollow etc. ) you should set their path variable to null when you pool it ( or pool the path first, see the script’s internals to see how it handles discarding paths, it will involve a call to path.Release ).
Looks like a cool game!
thanks… good to know… setting it to null sounds like a quick solution. thanks