Am I missing something? I added using UnityEngine.AI and public NavMeshSurface[ ] surfaces; and it gives me the Error.
Hope someone can help me. I am creating a procedural level out of a bunch of Prefabs (as walls) and a primitive plane as floor. So I guess I’ll need to set the prefabs child cube meshes Navigation Static true and not Walkable. However untill the namespace issue isn’t solved the rest won’t make sense anyways.
GroZZler, actually I put them into a wrong folder. However, no I get a bunch of warnings about obsolete things. I’ll see if i get it to work now. Thanks for pointing me to it
LurkingNinjaDev, didn’t think about this being the case
ok… so now I got a general question. How would I add the instances created from the script to surfaces?
for example in a loop i create walls:
GameObject wall = (GameObject)Instantiate (Wall, pos, Quaternion.AngleAxis (0, Vector3.up));
how can i add those wall objects to the NavMeshSurface[ ]?
The tutorial talks about procedural levels but doesn’t seem to show how to do it for real procedural level.
using Unity.AI.Navigation;//??? I can’t seem to access it. It won’t even let me do
using Unity.AI;
Am I missing something? And forget about installing it by github repository URL that didn’t work either. Burst is the first subdirective I get there is no A-section for Unity. It starts with B.
I could not find the reference Unity.AI.Navigation after installing the package. So I went to Package Manager settings in project settings and checked “Enable pre-release packages” in Package Manager settings. I then restarted my project… and it worked! - Not sure if I needed to enable that setting, maybe restart was enough.
Hopefully this might help someone, I had to import the AI Navigation package and then go to the Package Manager and download the samples of the package, scripts reloaded and I was able to use Unity.AI after this
After downloading the code from github to my project:
using UnityEngine;
using UnityEngine.AI;
[RequireComponent(typeof(NavMeshSurface))]
public class NavMeshTest : MonoBehaviour {
// don't forget to build out class
}
If your project still had that, time to remove it. Unity already packed this thing in official package list. (via com.unity.ai.navigation)
RESTART your editor once! Else assembly will not reload and editor wont see new namespace Unity.AI.Navigation
After editor opened again, you would re-enter the safe mode due to script compile failure. Mine was complaining about missing NavMeshSurface
Anywhere you have reference to NavMeshSurface you would have something like using UnityEngine.AI but it has moved, so using the new using Unity.AI.Navigation; instead
I got this error from the FPS Micrograme. It would appear they typed the namespace wrong. They had using UnityEngine.AI - which was greyed out indicating it was unused. So, I just replaced it with your suggestion and it fixed it.