0
\$\begingroup\$

guys!

I would like to create a map where the player can never reach the end while using the awesome navmesh agent from unity.

Is it achievable? I'm thinking of making a treadmill kind of logic with navmesh but since the environment have to be static, I don't think it's workable is it?

\$\endgroup\$
2
\$\begingroup\$

From my understanding the Unity NavMesh has to be baked so it's not something you can do in real-time. My advice would be to go and build your own path finding solution using the A* algorithm or something similar. Sebastian Lague has a fantastic tutorial on YouTube.

\$\endgroup\$
1
\$\begingroup\$

I know it's quite old one, but you should be able to achieve this with NavMesh Surface: https://docs.unity3d.com/Manual/class-NavMeshSurface.html

It's official created by Unity, but it's not part of Unity though as of now - check that link for how to install it.

NavMesh Surface can be prefabed along with NavMesh itself and connected such e.g. planes are automatically connected together, so you should be able to instantiate such prefab with script as needed, while keeping NavMesh functionality and to add another benefit of this - it actually can be in 2D game as well (e.g. top-down shooter) since there is no angle restriction for baking.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.