Renamed OpenDoor.h and OpenDoor.cpp and entire project is broken

As the title suggets, I renamed these files and now no matter what I do I cannot get anything working. Tried checkout, deleting files, reopening Unreal and then the IDE and everything is still broken. I tried resetting the branch to an earlier commit. Everything is broken. Cannot even get the project to open and the solution cannot be built. The video said go ahead and rename the class so I renamed the class and then also the file name to match and it wasn’t covered when I came back and now I cannot do anything with all the work I’ve done. No idea what to do. Very Very Frustrated.

Went Back A few commits and was able to get most of my work back. Still, what happened was very strange. I think some files got corrupted when I was renaming.

Word to the wise. Be very careful and make a commit AND save a backup before you do any renaming of actual files.

So I tried this just to see if I could break it.

No issue. I am on a Mac and XCode does not refactor C++. So I had to ensure every instance in any files to that class name/file name. No to mention every instance of it in Unreal Engine. Very strange this happened to you.

Maybe make a new branch to test it out. See if you can break it again and fix it without rolling back commits.

I went back 2 commits and it seems to be fine now. PC works a bit differently I think. Renaming files can get you into a lot of trouble. I think what happened was there was some error or file corruption as I was renaming files but I must have saved. Then when it tried to recompile it couldn’t create the generated.h file for the OpenDoor class.

Anyway I fixed it. Just be really careful when renaming your files on PC and make sure to save and make a backup zip folder before you do any renaming of the actual files.

Hi mate,

I was also wondering, before seeing the whole video, if Ben would rename the file as well as the class. Turns out he didn’t, and not doing it would have saved you a lot of trouble. I think it’s a point of feedback to the course, since renaming the OpenDoor class is not what was expected, but the instructions were misleading.

Privacy & Terms