Custom C++ UObject Class Reference Resetting After Restarting Editor

Make sure that the header file is inside of the game projects source folder. VS sometimes puts it inside of the intermediate folder (very frustrating). This can cause the file to not be seen by the project correctly.

Go into the folder where your custom header files exists. You can right click the file in vs and open folder where the file resides. If it’s in the intermediate folder then cut it and paste it into the source folder and then from within vs choose add existing file and reimport the header file.

It might also be a file visibility problem though it would throw a compiler error if a file was not found correctly

Also if you moved the files at any point in the project, fixing redirects from the content browser can sometimes fix weird issues.

You can always try a fresh project with just the header and see if it behaves as expected. You could then narrow down the cause.