stride3d/stride · error · Exception

NavigationProcessor can not access the game systems…

Error message

NavigationProcessor can not access the game systems collection

What it means

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.

Solutions

  1. Ensure navigation runs under a proper Stride Game instance that registers IGameSystemCollection
  2. Add the NavigationProcessor within the standard game/scene system setup, not a custom host
  3. Register an IGameSystemCollection (GameSystemCollection) in the Services registry before adding the processor
Defensive patterns

Strategy: validation

Validate before calling

var collection = Services.GetService<IGameSystemCollection>();
if (collection == null)
    throw new InvalidOperationException("Navigation requires a Stride Game with IGameSystemCollection registered");

Try / catch

try { sceneSystem.Services.GetService<IGameSystemCollection>(); }
catch { /* fall back to full Game host or skip navigation setup */ }

Prevention

When it happens

Trigger: 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).

Common situations: Running navigation outside the normal Stride Game lifecycle, custom engine hosts, headless/test setups, or constructing processors manually with their own ServiceRegistry.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/a99fe834b63b0901. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Navigation/Processors/NavigationProcessor.cs:41

        private DynamicNavigationMeshSystem dynamicNavigationMeshSystem;
        private GameSystemCollection gameSystemCollection;

        /// <inheritdoc />
        public override void Update(GameTime time)
        {
            // Update scene offsets for navigation components
            foreach (var p in ComponentDatas)
            {
                UpdateSceneOffset(p.Value);
            }
        }

        /// <inheritdoc />
        protected override void OnSystemAdd()
        {
            gameSystemCollection = Services.GetService<IGameSystemCollection>() as GameSystemCollection;
            if (gameSystemCollection == null)
                throw new Exception("NavigationProcessor can not access the game systems collection");

            gameSystemCollection.CollectionChanged += GameSystemsOnCollectionChanged;
            TryRegisterDynamicNavigationMeshSystem();
        }

        /// <inheritdoc />
        protected override void OnSystemRemove()
        {
            if (gameSystemCollection != null)
            {
                gameSystemCollection.CollectionChanged -= GameSystemsOnCollectionChanged;
            }

            if (dynamicNavigationMeshSystem != null)
            {
                dynamicNavigationMeshSystem.NavigationMeshUpdated -= DynamicNavigationMeshSystemOnNavigationMeshUpdatedUpdated;
            }
        }

View on GitHub (pinned to 96fad776d2)