As a fairly new UE developer, I am struggling finding a workable solution for organizing C++ classes within my UE5 project. My goal is to create a folder structure under the Source/Project path, that would allow me to keep classes that are related located together. UE seems to be happy if there is just Public and Private folders, w/ include files in the Public folder, and implementation files in the Private folder, but this gets unwieldy w/ even a handful of classes. I have scoured the UE C++ documentation to no avail. Online searches and Copilot queries did offer a promising option which was to define w/in the Build C# file PublicIncludePaths and PrivateIncludePaths, but after defining every conceivable path combination with them1, I still get compiler error stating the include references can’t be found in the implementation files. So do I actually have to modify the include path references within the implementation files after the class wizard generates a new class? What is the guidance for this workflow from an expert developer? Thanks in adavance.
i haven’t use public/private in half a decade. i don’t think they are useful. not even on a plugin.
i organize files based on the logical components and responsibilities.
on my build.cs and target.cs i don’t have any “publicincludepaths”. ue automatically gather all files in the Source folder, for the corresponding module. even in subfolders.
feel free to organize the code the way you want. even if the documentation states the “best” practices or recommended workflow you’re always free to experiment and find what works best for you.
this is a plugin i’ve made if you want to check out the layout and config Making sure you're not a bot!