I cannot create new folders in the c++ code source folder in the ue4 editor. I downloaded the Shooter Game template and when I right click on the source code folder the “new folder” button is grey out. Even if I create new c++ class in a different folder the folder doesnt appear …
Apologies, the “New Folder” option for C++ classes was never hooked up, however you should just be able to type in a sub-path when using the “New C++ Class” option, and then the addition of that class will cause your new sub-folder to appear.
The phrasing of your question makes it sound like that might not be working though? If so, has your new class definitely been compiled? (This should happen automatically unless you changed your project settings to require a manual compile and hot-reload).
I tried with “New C++ class”. I add my folder in the path field. I validate this, unreal creates all its stuff and compile the new class. After this the folder still does not appear in the the project. I also tried to compile in VS with the config development editor (the folder is existing on the vs side), and my folder is still unexist in UE editor :(.
Strange. I just tested this myself and it worked as expected.
What class were you trying to create, and what path were you trying to create it at? I also assume from your screenshot that you’re using the ShooterGame sample project?
Also, could you check for me that you have “Show Folders” enabled under the “View Options” in the Content Browser. Thanks.
This is still broken in 5.1, 7 years after the first post RIP. We still cannot create folders in the UE editor, I have tried running as admin, tried updating my rider link plugin, tried using the public/private folder layouts.
Trying to get C++ files to show reliably in both rider and the UE editor is still very buggy
What you can do is when adding a new C++ class, define the folder within which to add. You can add a new folder at this step. Afterwards, when you recompile the project, the class will be in the correct folder and the folder will show up in the UE editor.
Everybody who has said add the path in the “Add C++ Class” Dialogue is correct - this will place the new C++ class within a subfolder. However, it is still not visible in the editor, even after recompiling. This also means you cannot create a Blueprint class from it.
Steps to fix
Add new class with the dialogue, adding the path to the save location
Close the editor and VS Code / Studio
Go to the project folder and delete the .code-workspace or .sln file and the Binaries and Intermediate folder.
Open the .uproject file
It will prompt you to rebuild, select “Yes”
Regenerate VS Code / VS Studio files from Tools → Generate VS Project
Your C++ classes should now be visible in the Content Browser. I have not found a way around this - I have to do it for each new class, but it keeps everything tidy.
I’m also using Perforce - I don’t seem to have this issue on non-VCed projects, so maybe that has something to do with it.
It looks like a lot of hassle, but at least that workflow worked for me. I can see the codes I create inside the subfolders in the main “C++ Classes” folder. So at least there is a way. Thank you for sharing it.
I had a very similar issue with this and my problem was ultimately that when trying to compile from vsc it couldn’t link the .cpp + .h files because the whatever.h ‘didnt exist’ however the actual problem was that the generated includes were wrong and i had to correct it manually. hope that helps someone 'cause it was frustrating esp. since it was working before. lol