Giter VIP home page Giter VIP logo

Comments (8)

h8man avatar h8man commented on June 6, 2024 1

NavMeshPlus, I'm checking right now if I have bad reference

from navmeshplus.

h8man avatar h8man commented on June 6, 2024

I dug a bit deeper on this - I was thinking to try to render the mesh myself in the RenderGizmoSelected - then it occurred to me to check out how it works for built in NavMeshSurface. I discovered the AI Navigation package's NavMeshSurfaceEditor has some code for "UNITY_2022_2_OR_NEWER" which does this:

navSurface.navMeshDataInstance.FlagAsInSelectionHierarchy();

I tried adding that to NavMeshPlus's NavMeshSurface, but unfortunately that FlagAsInSelectionHierarchy method is internal and therefore not accessible. However, calling it via reflection does seem to do the trick:

[DrawGizmo(GizmoType.Selected | GizmoType.Active | GizmoType.Pickable)]
static void RenderBoxGizmoSelected(NavigationSurface navSurface, GizmoType gizmoType)
{
    var method = navSurface.navMeshDataInstance.GetType().GetMethod("FlagAsInSelectionHierarchy", BindingFlags.NonPublic | BindingFlags.Instance);

    method.Invoke(navSurface.navMeshDataInstance, new object[] { });
    RenderBoxGizmo(navSurface, gizmoType, true);
}

It's hacky, for sure, but at least I can see my navmesh now and debug other issues. Hope this is of use to someone, and that the problem can be resolved somehow in NavMeshPlus in the future (hopefully without hacky reflection calls!).

from navmeshplus.

behdadsoft avatar behdadsoft commented on June 6, 2024

Hi.
Unfortunately I have same problem after switch form unity 2021 to 2022.

What is NavigationSurface assembly reference in above method?

Capture

from navmeshplus.

behdadsoft avatar behdadsoft commented on June 6, 2024

using NavMeshPlus.Components already added but can't recognize NavigationSurface.

from navmeshplus.

h8man avatar h8man commented on June 6, 2024

I have Navigation.AI and navmeshplus is the same project installed. Build and run works totally fine.
Try using NavMeshSurface = NavMeshPlus.Components.NavMeshSurface;

Chek if files are in place or try

from navmeshplus.

behdadsoft avatar behdadsoft commented on June 6, 2024

I reinstalled navmeshplus and errors have been fixed. but the biggest problem is still exist and baking not work correctly. in the picture below, Part of the environment is baked, While all the environment inside the green frame should be baked. I had this problem when I converted my project from unity 2021 to 2022 and tried bake my scene in new version.

Capture

from navmeshplus.

h8man avatar h8man commented on June 6, 2024

Check components naming. Maybe you have mix of Navigation.AI and NavMeshPlus.
Also check what default area is and what you have in your modifiers.

from navmeshplus.

behdadsoft avatar behdadsoft commented on June 6, 2024

The components used are correct. I used Navigation Modifier for the floor and (Navigation Surface and Navigation CollectSources2d) for NavMesh. I made a new scene and test it again, Everything seems to be working fine.
It seems that my project has a problem after converting to the new version of Unity.
Thank you for your help and time.

from navmeshplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.