So, I’m working on a game in which the map is randomly generated each time it’s started. Just to give you an idea: The terrain is basically built up of multiple cuboids all positioned at -1 on the Y axis and at various points on the X and Z axes so it basically just makes a large flat area composed of tiles which allows me to have various resources randomly placed (or not) on them and allows me to have a fog of war system where each has its mesh renderer enabled as the player gets close to it. The player then starts at 0.6 on the Y axis (this just seemed to work best).
When I saw that 5.6 implemented NavMeshes that could be baked on runtime I thought it was great because it would solve my pathing issues. And I have got it to work, except for the fact that there seems to be an issue with the Agent connecting to the mesh. After the game starts, I get a message in the console saying “Failed to create agent because it is not close enough to the NavMesh.” If I wait a few minutes, the Agent seems to be shoved downward a little on the Y axis in a janky kind of way, at which point it seems to connect to the NavMesh and it works. But this is an issue because obviously it’s no good that it takes so long to kick in and also the agent being pushed down means it clips through the terrain. I tried playing around with the Agent component’s Base Offset parameter to see if that helped but it didn’t seem to make a difference. Anyone have any advice about what’s going wrong?
Thanks!