{"record":{"id":"a99fe834b63b0901","repo":"stride3d/stride","slug":"navigationprocessor-can-not-access-the-game-systems","errorCode":null,"errorMessage":"NavigationProcessor can not access the game systems collection","messagePattern":"NavigationProcessor can not access the game systems collection","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Navigation/Processors/NavigationProcessor.cs","lineNumber":41,"sourceCode":"        private DynamicNavigationMeshSystem dynamicNavigationMeshSystem;\n        private GameSystemCollection gameSystemCollection;\n\n        /// <inheritdoc />\n        public override void Update(GameTime time)\n        {\n            // Update scene offsets for navigation components\n            foreach (var p in ComponentDatas)\n            {\n                UpdateSceneOffset(p.Value);\n            }\n        }\n\n        /// <inheritdoc />\n        protected override void OnSystemAdd()\n        {\n            gameSystemCollection = Services.GetService<IGameSystemCollection>() as GameSystemCollection;\n            if (gameSystemCollection == null)\n                throw new Exception(\"NavigationProcessor can not access the game systems collection\");\n\n            gameSystemCollection.CollectionChanged += GameSystemsOnCollectionChanged;\n            TryRegisterDynamicNavigationMeshSystem();\n        }\n\n        /// <inheritdoc />\n        protected override void OnSystemRemove()\n        {\n            if (gameSystemCollection != null)\n            {\n                gameSystemCollection.CollectionChanged -= GameSystemsOnCollectionChanged;\n            }\n\n            if (dynamicNavigationMeshSystem != null)\n            {\n                dynamicNavigationMeshSystem.NavigationMeshUpdated -= DynamicNavigationMeshSystemOnNavigationMeshUpdatedUpdated;\n            }\n        }","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Navigation/Processors/NavigationProcessor.cs#L23-L59","documentation":"Thrown by NavigationProcessor.OnSystemAdd when the game's IGameSystemCollection service cannot be resolved (or is not a GameSystemCollection). The processor needs the game system collection to track dynamic navigation mesh systems added/removed at runtime.","triggerScenarios":"Adding a NavigationProcessor to a service registry that was not created by a Game (e.g. a bare SceneSystem, custom SceneInstance, or unit-test service provider lacking IGameSystemCollection).","commonSituations":"Running navigation outside the normal Stride Game lifecycle, custom engine hosts, headless/test setups, or constructing processors manually with their own ServiceRegistry.","solutions":["Ensure navigation runs under a proper Stride Game instance that registers IGameSystemCollection","Add the NavigationProcessor within the standard game/scene system setup, not a custom host","Register an IGameSystemCollection (GameSystemCollection) in the Services registry before adding the processor"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var collection = Services.GetService<IGameSystemCollection>();\nif (collection == null)\n    throw new InvalidOperationException(\"Navigation requires a Stride Game with IGameSystemCollection registered\");","typeGuard":null,"tryCatchPattern":"try { sceneSystem.Services.GetService<IGameSystemCollection>(); }\ncatch { /* fall back to full Game host or skip navigation setup */ }","preventionTips":["Always run navigation inside a standard Stride Game lifecycle","Avoid manual processor construction with custom ServiceRegistries","In tests, register a GameSystemCollection stub before adding processors"],"tags":["navigation","game-lifecycle","service-registry"],"backgroundTag":"missing-dependency","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}