-
Notifications
You must be signed in to change notification settings - Fork 204
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
Unity editor Bake functions differently to scripted break. #41
Comments
Hello @darthmorf There are a lot of #if UNITY_EDITOR declarations in scripts that I took form Unity's NavMeshSurface repo. So yes, it definitely can affect, probably, I don't know. You can put break point or add logs to catch what sources are collected (also print polygon points to be sure): That is pretty much all I can advice in troubleshooting. But feel free to ask any related questions on further troubleshooting |
Hi @h8man I'm working with @darthmorf. About this point:
Yeah, we found that out reading the forum post - it's not a problem for us in the end. Now, I'd like to add some additional information to see if you have any more thoughts: I actually noticed that this issue is not so much related to the fact that we're using a collider on a GameObject instead of a Tilemap, but rather it's based on how the sources are collected (or not collected) when we change the "Use Geometry " Setting of the Essentially, if we have it set to As Darthmorf said though, if we use the Bake button on the We'll try to work on getting that specific information you said as well:
|
Hello @GitFlip There is one more place to take a look
It may return NULL without warnings. On this case we can ask directly to MelvMay on what is happening. If you add delay between map generation and baking, does it help? |
Thanks for the suggestions @h8man. I decided to take the approach of understanding why the collider is getting updated correctly at a later point and time, and ran into some good documentation about the collider's bounds not getting updated to match the transform until How we were generating things was instantiating the prefab, setting the transform of this new game object, and eventually programmatically baking. This all happened then before To remedy this I simply forced the update by calling FYI: https://docs.unity3d.com/ScriptReference/Physics2D.SyncTransforms.html So I think that this issue can be closed, but maybe this info is worth mentioning somewhere? Not sure if you really need to though as it's a fundamental part of Unity Physics not NavMeshPlus. Thanks again! |
@GitFlip , You certainly right. I getting more and more question about baking at runtime, so many other users may encounter this. Wiki updated Issue 'resolved' |
I'm developing some 2D isometric world generation logic using
NavMeshSurface2d
andNavMeshModifer
scripts. So far, all the tile colliders have worked ok when baked with the script (callingNavMeshSurface2d.BuildNavMesh
).However, when adding a GameObject to the mix which has it's own polygon collider, the script call to bake the mesh does not include the gameobjects' colliders. When I generate the world, then press bake from the UI the colliders are baked fine.
Is there a reason it would work from the GUI but not scripted? Could it be a timing issue? Do I need to 'construct' the colliders somehow?
The text was updated successfully, but these errors were encountered: