- Home /
Missing NavAgent after loading scene?
I have a scene that breaks because of a missing component whenever I load it, say via SceneManager.LoadScene(0), although we have tried loading via other methods as well. It appears the NavAgent goes missing, at least according to the error log, but it is definitely there and still on the object. If I simply play the scene with the editor and without loading into it then it works just fine. What might be the problem here?
Additional behavior, if I just try to re-retrieve the navmeshagent via GetComponent, it says that the script was destroyed? However, the script it says is destroyed is the very same that is running the code that gets that error? While the script can be seen on the object still.
if a object need be transported between scenes use DontDestroyOnLoad(object);
try see this Persistence - Saving and Loading Data
This is not about objects that need to be transported in between scenes, it is about a scene that contains all of its necessary objects of which some disappear when it is loaded.
Your answer
Follow this Question
Related Questions
NavMeshAgent delay? 0 Answers
Connecting two navmeshes without "Speedboost" 0 Answers
How to make NavMeshAgents traverse two possible paths 1 Answer
Loading Scree 2 Answers
Baking NavMesh at Runtime: Connecting separate NavMeshSurfaces 0 Answers