Comments (8)
NavMeshPlus, I'm checking right now if I have bad reference
from navmeshplus.
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.
Hi.
Unfortunately I have same problem after switch form unity 2021 to 2022.
What is NavigationSurface assembly reference in above method?
from navmeshplus.
using NavMeshPlus.Components already added but can't recognize NavigationSurface.
from navmeshplus.
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.
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.
from navmeshplus.
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.
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)
- Overlapping Walkable on top of Obstacle won't work.. HOT 4
- netcode and navmeshplus HOT 1
- How i can re-bake in the game mode.
- NavMeshCollecSources2d script does not exist HOT 2
- If there is no tile, don't bake that area
- Upgrading to 2022 HOT 5
- NavMeshAgent.SetDestination does not work HOT 3
- Same tilemap can't have two different surfaces HOT 3
- Everytime I load unity scripts missing HOT 1
- Does not work properly with custom cell size HOT 2
- [Bug] NavigationModifierTilemap missing AffectedAgents field HOT 2
- Isometic grid issues doesn't fit HOT 4
- Make the 2D Agent face in the direction of movement? HOT 2
- Enemy not moving after git push and pull in other computer HOT 2
- NavMeshPlus baking walkable area weirdly HOT 5
- CS0618: 'NavMeshVisualizationSettings.showNavigation' is obsolete ? HOT 2
- NavMesh Modifier Volume not working HOT 8
- Navmesh Tilemap help wanted HOT 3
- Problem when importing package HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from navmeshplus.