1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unity 2018 NavmeshBuilder.BuildNavMeshAsync

Discussion in 'Programming/Internet' started by Marc Rasmussen, Oct 8, 2018.

  1. I am trying to test out the new Navmesh tools as of Unity 2018.1

    So i have a simple scene with a plane:

    [​IMG]

    Then i have the following script:

    public class SpawnObject : MonoBehaviour
    {
    public GameObject ObjectToSpawn;
    // Update is called once per frame
    void Update()
    {
    if (Input.GetMouseButtonDown(0))
    {
    RaycastHit hit;
    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

    if (Physics.Raycast(ray, out hit))
    {
    if (hit.transform.name == "floor")
    {
    Instantiate(ObjectToSpawn, hit.point, Quaternion.identity);
    NavMeshBuilder.BuildNavMeshAsync();
    }
    }
    }
    }
    }


    This spawns a prefab and then i attempt to update the navmesh however nothing really happens:

    [​IMG]

    The cube I am spawning has the following properties:

    [​IMG]

    Can anyone tell me what I am doing wrong?

    Login To add answer/comment
     

Share This Page