{"record":{"id":"4dfb1dfef892b1f0","repo":"FyroxEngine/Fyrox","slug":"unable-to-load-script-instance-of-id-in-new-for","errorCode":null,"errorMessage":"Unable to load script instance of id {} in new format! Trying to load in old format...","messagePattern":"Unable to load script instance of id (.+?) in new format! Trying to load in old format\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"fyrox-impl/src/script/mod.rs","lineNumber":739,"sourceCode":"}\n\nimpl DerefMut for Script {\n    fn deref_mut(&mut self) -> &mut Self::Target {\n        &mut *self.instance\n    }\n}\n\nimpl Visit for Script {\n    fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {\n        let mut region_guard = visitor.enter_region(name)?;\n\n        // Check for new format first, this branch will fail only on attempt to deserialize\n        // scripts in old format.\n        if self.instance.visit(\"Data\", &mut region_guard).is_ok() {\n            // Visit flags.\n            self.initialized.visit(\"Initialized\", &mut region_guard)?;\n        } else {\n            Log::warn(format!(\n                \"Unable to load script instance of id {} in new format! Trying to load in old format...\",\n                self.id()\n            ));\n\n            // Leave region and try to load in old format.\n            drop(region_guard);\n\n            self.instance.visit(name, visitor)?;\n\n            Log::warn(format!(\n                \"Script instance of id {} loaded successfully using compatibility loader! Resave the script!\",\n                self.id()\n            ));\n        }\n\n        Ok(())\n    }\n}","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/FyroxEngine/Fyrox/blob/76c91aad8eca488ce527b1af707be8b3b24ad72d/fyrox-impl/src/script/mod.rs#L721-L757","documentation":"When deserializing a ScriptInstance, Fyrox first tries the 'new' serialization format by visiting the 'Data' region. If that visit fails, the script data is presumably in the legacy format, so this warning is logged and a compatibility loader for the old format is attempted. It is an expected branch when loading scenes saved by older engine versions, not a hard failure — but it indicates the asset must be re-saved.","triggerScenarios":"Loading a scene/prefab whose scripts were serialized with an older Fyrox version, so the 'Data' visit in the new format fails and the old-format path is used.","commonSituations":"Opening projects created before a script serialization format change; loading assets from an older engine release into a newer one.","solutions":["Load the scene once, then re-save it in the current editor so scripts use the new format.","Update project assets in bulk by loading and re-saving all scenes/prefabs after an engine upgrade.","If loading fails entirely, inspect the script's serialized properties against the current script definition."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Batch re-save scenes/prefabs after every engine upgrade.","Keep asset files in version control and regenerate them when format warnings appear.","Treat the warning as a one-time migration marker, not a runtime bug."],"tags":["fyrox","serialization","scripts","compatibility"],"backgroundTag":"deprecated-api-usage","analyzedSha":"76c91aad8eca488ce527b1af707be8b3b24ad72d","analyzedAt":"2026-09-10T16:04:01.633Z","contentChangedAt":"2026-09-10T16:04:01.633Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}