Dynamic Pathfinding in Unity 3.5

Hey!

So I’ve been messing around with the new navigation system in Unity. Works great on just static objects, however, if I have a non-static object it will walk right through it as if it’s not there. I realize this is because it’s not baked into the NavMesh.

Is pathfinding around Dynamic objects built in? Or is it something you would need to implement manually.
If it would need to be implemented manually how would I got about doing it? Pseudo-code or a theory would be great :smile:

Thank you!
why789

Is your dynamic object sitting on the navmesh? Check out this tutorial and see what he does with the big tree:

Unity3D NavMesh Tutorial - Unity3DGameCreator

I don’t see how that will help me… The object is still being baked into the NavMesh and if it moves than it will not rebake it and will not know it’s there.

Thank you,
why789

you must not add it as static object (statics can’t move, the name should be self explaining there)

Instead there are special actor types used for this purpose which naturally means you have to use the actors as well for it to work, you cant’ get it on the navmesh level, not with Unity Path Finding

So I would need to implement my own dynamic avoidance?

How would I go about doing this?

Unity has in the navmesh example a scene with a bridge if you have a lot of dynamic objects i guess you should read into pathfinding or buy a solution that changes in runtime.

I am going to have a lot of dynamic objects and it won’t be like a bridge where you can either walk over it or not. it will be a lot player movable objects so the agents have to avoid them. that is one of the main game mechanics…

Where would I start with dynamic pathfinding? would I implement it alongside the build in pathfinding?

thank you,
why789

From what I can see if you give the dynamic objects that you want your object to path around a nav mesh agent also, it will dynamically path around them

Take a look at the UnitySteer C# libraries. You can download example projects and the source code. I think 2.2 is the latest.
Although aside from the examples, there aren’t really any tutorials.

AngryAnt also has some pathfinding stuff.

Well… The agents are designed to avoid other agents, right… Why dont you just put an agent on your other player movable stuff, you can move it with simple code as long as it doesnt get out of the navmesh. Have you tried that?