So, part of the NextBot stuff is the idea of Paths. They’re pretty cool. You give it a target position and it will try to create a path to that place. Not just a simple path – but they can include jumping over gaps, and climbing up ladders.
They’re stupidly easy to use too. I’m trying to code them in a way so that they can be used independently of NextBot stuff, but this is the general idea.
So, in this code every second it’s re-computing a path to Entity #1. This is obviously just a test.. in single player Entity #1 is the player.
Here’s the result..
As you can see, they follow the player pretty religiously.. although they do seem to get stuck on each other when they’re colliding. I’m not sure whether that’s something I should handle in-engine.. or just expect the Lua coder to detect and protect against the AI getting stuck.