I am creating a NavMesh in runtime so that I would be able to create a path for the enemy AI, the problem however is that while the NavMesh generation worked outside of AR (I made a script that would build the NavMesh with objects in the prefab). But when I used the prefab inside of the AR in AR Foundation, things got a bit glitchy as even though I made sure that the Nav Mesh Generation is set to run at every frame the prefab existed, the error that "Failed to create agent because it is not close enough to the NavMesh" still exists, even though the error didn't appear when I removed the AR Component.
What's the problem with the NavMesh in AR Foundation?
Here's the image of the AR setup that I got, where I'm supposed to spawn the enemy gameobjects and create the NavMesh.
Here's the prefab that I'm using:
And here's the code for Image recognition: https://hatebin.com/weorcnsegd As well as the main code for spawning the objects and creating the NavMesh https://hatebin.com/jioqrhgbfq