{"record":{"id":"837b26e49572a351","repo":"stride3d/stride","slug":"no-scene-match-the-given-sceneid","errorCode":null,"errorMessage":"No scene match the given {sceneId}","messagePattern":"No scene match the given (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/editor/Stride.Assets.Presentation/AssetEditors/SceneEditor/Game/SceneEditorGame.cs","lineNumber":249,"sourceCode":"\n            // Find virtual anchor\n            var anchorIndex = parent.Entities.IndexOf(x => x.Id == scene.Id);\n            if (anchorIndex != -1)\n            {\n                var anchorEntity = parent.Entities[anchorIndex].Components.OfType<VirtualAnchorScript>().FirstOrDefault();\n                // Remove anchor script\n                if (anchorEntity != null)\n                    Script.Remove(anchorEntity);\n                // Remove virtual anchor\n                parent.Entities.RemoveAt(anchorIndex);\n            }\n        }\n\n        [NotNull]\n        private Scene GetScene(Guid sceneId)\n        {\n            if (!scenes.TryGetValue(sceneId, out Scene scene))\n                throw new InvalidOperationException($\"No scene match the given {sceneId}\");\n\n            return scene;\n        }\n\n        /// <summary>\n        /// Script that synchronizes the scene offset to the virtual anchor position.\n        /// </summary>\n        /// <remarks>\n        /// We use an indirection with a virtual anchor to be able to display a gizmo that the user can manipulate.\n        /// In a real game, this indirection is not needed, and the scene offset should be directly modified instead.\n        /// </remarks>\n        private class VirtualAnchorScript : AsyncScript\n        {\n            private new SceneEditorGame Game => (SceneEditorGame)base.Game;\n\n            /// <inheritdoc />\n            public override async Task Execute()\n            {","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/editor/Stride.Assets.Presentation/AssetEditors/SceneEditor/Game/SceneEditorGame.cs#L231-L267","documentation":"SceneEditorGame.GetScene looks up the game-side Scene instance for a sceneId in its internal scenes dictionary and throws InvalidOperationException when no scene with that id is registered. It is the central resolution point for child scenes loaded into the editor's game session.","triggerScenarios":"Calling LoadEntity/UnloadEntity/UnloadEntities (or scene offset sync paths via parent/scene/newParent/anchor) with a sceneId that was never passed to the scene-loading API, or that was loaded then unloaded.","commonSituations":"Operating on a child scene whose load operation has not completed yet; referencing a scene asset that was reloaded/re-imported and received a new id; stale references after a scene was removed from the hierarchy.","solutions":["Ensure the child scene is loaded (EnsureContentScene / the scene-loading path) before performing entity operations against its id.","Refresh stale scene ids after asset reload by re-resolving them from the current asset collection.","Check SceneEditorGame.IsSceneLoaded (or equivalent tracking) before calling, or wrap calls in try/catch on InvalidOperationException."],"exampleFix":"// before\nvar scene = game.GetScene(asset.Id); // asset may not be loaded game-side\n// after\nif (!game.IsSceneLoaded(asset.Id))\n    await game.LoadSceneAndWait(asset);\nvar scene = game.GetScene(asset.Id);","handlingStrategy":"try-catch","validationCode":"// track loaded scenes yourself before calling APIs that resolve by id\nif (!loadedSceneIds.Contains(sceneId))\n    await LoadSceneAsync(sceneAsset);","typeGuard":"bool SceneIsLoaded(SceneEditorGame game, Guid sceneId) => game.IsSceneLoaded(sceneId); // or maintain your own set of loaded ids","tryCatchPattern":"try { var scene = editorGame.GetScene(sceneId); /* use scene */ }\ncatch (InvalidOperationException ex) when (ex.Message.StartsWith(\"No scene match\")) { await ReloadSceneAsync(sceneId); }","preventionTips":["Load the child scene before any entity/offset operations against its id.","Invalidate cached scene ids whenever assets are reloaded or re-imported.","Subscribe to scene-unloaded events and drop references then."],"tags":["resource-not-found","scene-editor","lookup-failed"],"backgroundTag":"resource-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}