-
Notifications
You must be signed in to change notification settings - Fork 187
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
Nav Agent doesn't find the mesh when programatically instantiated #169
Comments
there is a lot of those peculiarities with Unity) But Agent is native unity component, so there is nothing I can do except add some text in wiki |
I get it. That'd be great to document for the next person who gets into the same issue. I'm probably not alone generating nav agent through code. :) thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I want to report a potential issue when spawning nav agents on an existing mesh.
As a reference, I did open the following issue (To which I couldn't respond for a long times due to special circumstances, sorry for that): #154
After a lot of troubleshooting and nothing really making any sense, It worked in another scene where I replicated the demo, but then I saw it didn't when I programmatically spawned navAgent on the mesh, returning an error message saying it didn't find a close enough mesh. I did find a workaround by disabling the nav agent component and re-enabling it in the "start" function. it then finds the "closest mesh" and works normally from there.
All these times, I thought my mesh wasn't good and that I wasn't refreshing it properly but It was just fine.
So yeah. I think the nav agent might try to find the mesh before it's actually ready and thus, doesn't find it. I'm not sure exactly.
Just as reference, the code for me enemy that uses the mesh:
and just in case the way I instantiate it is important, here's the code:
The text was updated successfully, but these errors were encountered: