nvm it was something else
Second NavMesh Surface refuses to cooperate: Failed to create agent because it is not close enough to the NavMesh
I'm making a click to move based game and am using NavMesh to handle the pathfinding around walls and across terrain. I have two separate NavMesh surfaces (using the NavMeshSurface and stuff from Unity's github) for two different types of agents (one for the player character, other for the minions). Since I plan on having the map change multiple times during runtime, I wrote a script that handles it, so take a look at that in case it could be impacting anything.
The problem is as follows: I get the following error code in the editor both for the player character and the minions: Failed to create agent because it is not close enough to the NavMesh
. The player character pathfinding works without problems, but the minions won't respond to Agent.SetDestination() at all.
I don't instantiate the minions during runtime, they were added in editor and placed directly on top of the NavMesh surface, which has the same coords as the player char surface. Minion controlling code can be found here. Here's a snippet out of my character controlling code for movement. Made with Unity 2019.3.11f1, latest version of the NavMesh stuff from github.
Things I tried: I tried enabling the agent at runtime, in case Unity attempts to create the agent before generating the NavMesh; added more RAM and heavily reducing the size of the terrain and everything on it in hopes of the problem being with insufficient memory; used Agent.Warp() in Start() to try and initialize the position before calling SetDestination(); searched basically all questions on answers.unity vaguely related to this; no success. Both NavMesh surfaces are baked.
I am fairly new to unity (this is my third project) and I appreciate any help. I am open to sharing any assets or any code you guys may need to help me solve this.