I think the problem is most likely related to module name, when you make C++ project you actually making project with C++ module, one of many already in existing in the engine. The name of modules is independent from project name, but by default created module will have the same name as newly created project. Module name is part of the path name to class in reflection system and if it’s different then it wont match with the path name in the old project in level data and class will be considered missing in new project
Try doing this:
Copy the module folder (one after “Source”) with the same name to new project, delete all code files that you don’t need (leave cs files, modulename.cpp and .h) and leave only level script class and it’s dependencies (so what you need). Now add module to uproject file by editing it in text editor, like this:
"Modules": [
{
"Name": "ModuleWithNewProjectName",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine"
]
},
{
"Name": "ModuleWithOldProjectName",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine"
]
}
]
You also need to add module in to .target.cs files in Source directory, just add another line like this in same spot on both files:
ExtraModuleNames.AddRange( new string[] { "ModuleWithOldProjectName" } );
Now regenerate VS project files (there option for that in right click of uproject file) and this way you got another module with old name, with should allow to properly migrate the asset. After that you can make same class with different name in module with new project name, properly switch it in project settings and load and save the level (make sure level definitely runs on new class), delete the old name module and it reference in uproject to fully migrate the asset.
Now here protip for future, if you got some C++ code for level blueprint and you plan to reuse it in all of your project, consider making plug in, this will save you a all that trouble as you gonna have module in plugin that have same name regardless where you using it and should work in any project.