wesleywh / EasyMultiplayer-Invector

Where to submit issues for "Easy Multiplayer - Invector" suite of packages that is available via GumRoad or the Unity Asset Store. GUMROAD: https://cyberbulletgames.gumroad.com/ ASSET STORE: https://assetstore.unity.com/publishers/34070
0 stars 0 forks source link

AI Broken When Rebuild Navmesh #24

Closed orangeagain closed 2 years ago

orangeagain commented 2 years ago

Describe the bug AI navigate broken when use "NavMeshComponents" to rebuild navmesh in runtime

To Reproduce Steps to reproduce the behavior (Please include whether this was attempted with "Hosted Mode" or "Dedicated Server Mode"):

  1. import NavMeshComponents library
  2. attach test runtime script

    [RequireComponent(typeof(NavMeshSurface))]
    public class BakeNavMeshRuntime : MonoBehaviour
    {
    
    public LayerMask IncloudLayers = -1;
    [SerializeField] NavMeshSurface navMeshSurface;
    
    [Header("EditorRuntimeTriger")]
    public bool BuildNavMeshTriger = false;
    
    void Start()
    {
        if (navMeshSurface == null) navMeshSurface = GetComponent<NavMeshSurface>();
    }
    
    void Update()
    {
    
        if (BuildNavMeshTriger)
        {
            Debug.Log("Rebuild");
            navMeshSurface.layerMask = IncloudLayers;
            navMeshSurface.BuildNavMesh();
            BuildNavMeshTriger = false;
        }
    }
    }
  3. AI work in invector scene and not work in EMI shooter scene

Expected behavior continue navigation like invector shoot scene Screenshots/YouTube Links

Invecot runtime rebuild navmesh:

https://user-images.githubusercontent.com/12761984/170882273-73f6249a-d927-4cd3-8640-6c84a8ac21cb.mp4

EMI runtime rebuild navmesh:

https://user-images.githubusercontent.com/12761984/170882388-3f1df434-417c-4e57-8793-2a0074327282.mp4

Versions

If you can reproduce this issiue, let me know please, thank you

orangeagain commented 2 years ago

Solved, because AI ground layer need be set