Clone / Share C++ Project

I was having a really hard time finding a guide on how to clone or download an Unreal Engine project that uses C++ classes. Fortunately, I managed to figure it out myself and wanted to share my approach to guide others who might face this struggle in the future. So if you want a hard copy of your project in your PC aside from the cloud, or you want to download a C++ project from Git, you first need to clone the repository using Git Desktop. That would be File > Clone Repository > GitHub.com > [the repository name]. Then, you can go to the newly created repository’s file location, open your project folder and launch the project by clicking on the .uproject type file. Because we need to create a Visual Studio solution file for our copy, and copy pasting another .sln type file won’t work. Now if the project had C++ classes, you will be welcomed by a bunch of error messages and the engine will warn you if you attempt to play the game or open the blueprints that used those C++ classes. You were probably already used to building your project from Visual Studio if you worked with C++ in Unreal Engine, but if you didn’t, what just happened is that the engine tried to create the assets dependent on C++ code before the code could be compiled. You might try to change the parent class of the blueprint from the class settings but you will soon realize that those poor things have been confused so much that they don’t even know what a parent class is! Those blueprints have been corrupted and even after you add the necessary codes to your project, they’re not coming back. They need to be replaced after you add code to the project. So what you wanna do now is creating a new C++ class from Tools > Create New C++ Class. Also select either public or private before hitting create since that would automatically create those files under the source file which will save us a little bit of time. Then you can go ahead and close the engine and head back to your project’s file location. Open up a new file explorer tab next to it and go to your original project’s file location, then copy the public and private C++ codes. If you’re a contributor, ask the guy you got access to the repository from to send you the codes. After that, paste them into your copy’s public and private folders. While you’re there you can also delete the temporary header and C++ files that you created for the public and private folders to automatically appear. Go back to your copy project’s main file location, delete the content folder and copy paste the original one using the same method. You can also remove the .vsconfig file if you like. And that should be it! Now you can finally open the automatically created .sln type solution file to open Visual Studio, build your project by hitting Ctrl + F5 and the original project should be on your PC exactly as it is!

1 Like

There were some unnecessary steps on this post but I wasn’t able to edit after I realized those. I’m also learning more about this forum and I just figured out that I could add a reply to make it the answer, and use that as an edit. So you can just copy everything in your project folder except for .vs folder, Source folder and the .sln file as well as version control folders if you have any. Then you can just open up the .uproject file, create a C++ class, then close the editor, go to the newly generated Source folder and replace the Public and Private folder with the original ones.