Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException in CalculateWorldBounds #102

Open
AbstractFlame opened this issue Nov 28, 2022 · 9 comments
Open

NullReferenceException in CalculateWorldBounds #102

AbstractFlame opened this issue Nov 28, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@AbstractFlame
Copy link

I've clicked on Rotate Surface to XY, have an agent and 2 tilemaps with NavMeshModifier.

StackTrace:

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.AI.NavMeshSurface2d.CalculateWorldBounds (System.Collections.Generic.List`1[T] sources) (at Library/PackageCache/com.h8man.2d.navmeshplus@4a5aec0a09/NavMeshComponents/Scripts/NavMeshSurface2d.cs:458)
UnityEngine.AI.NavMeshSurface2d.BuildNavMesh () (at Library/PackageCache/com.h8man.2d.navmeshplus@4a5aec0a09/NavMeshComponents/Scripts/NavMeshSurface2d.cs:190)
NavMeshManager.Bake () (at Assets/Scripts/NavMeshManager.cs:20)
TileMapGenerator.Start () (at Assets/Scripts/TileMapGenerator.cs:21)

@h8man
Copy link
Owner

h8man commented Nov 28, 2022

Hello, @AbstractFlame

NavMeshSurface2d - is obsolete, you should try extensions system with NavMeshCollectSources2d.
Or wait until it fixed\updated

@AbstractFlame
Copy link
Author

AbstractFlame commented Nov 28, 2022

Thank you for the fast answer :)

@RB3009
Copy link

RB3009 commented Dec 1, 2022

First of all: Thanks to h8man for your work!

I have the same Problem when Baking with NavMeshSurface ( i followed your current manual):
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.AI.NavMeshSurface.CalculateWorldBounds (System.Collections.Generic.List`1[T] sources) (at Assets/NavMeshPlus-master/NavMeshComponents/Scripts/NavMeshSurface.cs:434)
UnityEngine.AI.NavMeshSurface.UpdateNavMesh (UnityEngine.AI.NavMeshData data) (at Assets/NavMeshPlus-master/NavMeshComponents/Scripts/NavMeshSurface.cs:222)
UnityEditor.AI.NavMeshAssetManager.StartBakingSurfaces (UnityEngine.Object[] surfaces) (at Assets/NavMeshPlus-master/NavMeshComponents/Editor/NavMeshAssetManager.cs:124)
UnityEditor.AI.NavMeshSurfaceEditor.OnInspectorGUI () (at Assets/NavMeshPlus-master/NavMeshComponents/Editor/NavMeshSurfaceEditor.cs:265)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.b__0 () (at <71490f95a19640fc8659d65903937f08>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

@h8man
Copy link
Owner

h8man commented Dec 2, 2022

@RB3009

I don't know how it happen, I need test project to see it myself and debug lines

@henrylhee
Copy link

Bump.

First of all: Thanks to h8man for your work!

I have the same Problem when Baking with NavMeshSurface ( i followed your current manual): NullReferenceException: Object reference not set to an instance of an object UnityEngine.AI.NavMeshSurface.CalculateWorldBounds (System.Collections.Generic.List`1[T] sources) (at Assets/NavMeshPlus-master/NavMeshComponents/Scripts/NavMeshSurface.cs:434) UnityEngine.AI.NavMeshSurface.UpdateNavMesh (UnityEngine.AI.NavMeshData data) (at Assets/NavMeshPlus-master/NavMeshComponents/Scripts/NavMeshSurface.cs:222) UnityEditor.AI.NavMeshAssetManager.StartBakingSurfaces (UnityEngine.Object[] surfaces) (at Assets/NavMeshPlus-master/NavMeshComponents/Editor/NavMeshAssetManager.cs:124) UnityEditor.AI.NavMeshSurfaceEditor.OnInspectorGUI () (at Assets/NavMeshPlus-master/NavMeshComponents/Editor/NavMeshSurfaceEditor.cs:265) UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.b__0 () (at <71490f95a19640fc8659d65903937f08>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

@OleksiiKLSV
Copy link

@RB3009 @h8man Hi! Did you manage to fix it? I have a similar problem and I will attach some screenshots so you can better understand the error.

image
image

More context:
I set up a grid with a tilemap and now when I run "Bake" I get this error. But the error occurs only if I use "Use Geometry": RenderMeshes in the case of Physics Colliders - everything works fine
image

@mikiplaygames
Copy link

Hi, im having the same problem
image
image
image
Should I use colliders for now? Or is there easy fix for that

@GaLzZy
Copy link

GaLzZy commented Jul 16, 2024

Anybody fixed that problem cause I have the same issue

@h8man h8man added the bug Something isn't working label Aug 17, 2024
@painh
Copy link

painh commented Nov 20, 2024

I had the same phenomenon when I put the collider on the tile.

Resolved by changing the Use Geometry option to physics colliders in the navigation surface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants