C++ Classes not showing up in content browser

I am posting a solution for people coming here for an answer to this particular problem of not having c++ classes visible in the editor content browser.

Reproducing this was simple enough by opening some blueprint only project and adding a c++ class. The editor used the c++ classes correctly but they were not visible in the content browser.

The solution to this problem is deleting files and folders that are automatically built or copied the first time a project is opened, forcing unreal editor to recompile and recreate these files. While all below folders and files are not necessary to delete for the fix, it is considered good practice to let unreal editor recreate these files, especially if you are switching from a different engine build.

Delete these files and folders in your project folder:

  • .vs
  • Binaries
  • DerivedDataCache
  • Intermediate
  • Saved
  • *.sln

After you have deleted the files, right-click on .uproject file and click “Generate Visual Studio project files” for Unreal Editor to recompile and recreate the needed files.
Open newly created .sln file with Visual Studio, compile and run the project and you should see your c++ classes in the content browser.

18 Likes

It worked for me. Thanks!

For some this problem might be due to the sources panel is not shown. Click on the “Show or hide sources panel” just under Add/Import should help.
image

None of these suggestions worked for me. What did was modifying the .uproject file and adding the project Modules element:

{
	"FileVersion": 3,
	"EngineAssociation": "4.27",
	"Category": "",
	"Description": "",
	"Modules": [
		{
			"Name": "MyProject",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"AdditionalDependencies": [
				"Engine"
			]
		}
	]
}

You can just open up the .uproject file in a text editor and add the Modules element, just make sure you replace MyProject with the name of your project.

12 Likes

this was from 2017 still was not solved in Unreal 5 today !!! bs

1 Like

Any progress?

Hello,
I find the solution about the new C++ class doesn’t appear in the content browser ( that’s work for me).
I’m using visual studio 2022 or visual studio code in the same. Once your create the class, you need to compile with the “live coding” compiler from UE (UE5 for me) by pressing key ctrl+alt+F11 on Windows each time you make change on your code after saving this.
On the first time it will appear on content browser.

Have fun !

4 Likes

Seems this thread is split across different versions now but I had this happen in UE5. All I did was launch the .uproject file from Visual Studio 2019 using Local Windows Debugger. After my UE project opened, my C++ classes were in the content browser. I didn’t compile or save or anything, just closed VS and UE and reopened UE as normal and everything was still there. Cheers!

Hi,

I have the same problem but your solution didn’t work.

I created a C++ project in UE5 and added some classes. Every time I open a project from UE5 lanucher all my custom classes are gone. Launching “Live coding” compiler makes them visible in the content browser but all the actors of my classes that I placed in levels are gone.

The only solution that allows me to see my classes in the content borwser and their instances in levels is to start debugging the project in VS. But as soon as I close VS the project in UE5 closes as well. I find it silly to be forced to have VS launched only to modify e.g. placement of my actors in the levels.

This did it for me. Thank you!
I was seeing in past walkthroughs something about compiling the project, but couldn’t find how to actually do it in ue5.
So much headache prevented!

I was experiencing this issue with UE5.1 and was able to fix it.

First, I found that there were some compile issues with the C++ generated by the UE editor. When I was creating my new class, a placed them into a folder ‘Characters’. In my .cpp file, it was looking for my Toon.h file in “Chracters/Toon.h” instead of “Toon.h”. This looks to have happened because I forgot to click “Public” on the “New C++ Class” window after I changed the folder name.
Once I fixed those issues and got a successful build in Visual Studio, Unreal Editor crashed, and when it restarted my C++ classes where present like expected.

After creating my new C++ class, I got a very specific error explaining there was a build failure and my C++ classes could not be loaded. I had to fix a new issue in the generated .cpp file, rebuild, and then I got my C++ classes back again.

1 Like

Update: One way to try and avoid running into issues is to use “Run without Debugging” to run the Unreal Editor from Visual Studio. I have noticed that when I use “Add C++ Class”, it changes the project solution which will cause issues with Visual Studio if it was running in Debug mode and you do not stop and rerun the Unreal Editor. The easiest way to avoid having to rerun the Unreal Editor every time you create a new C++ class, is to Run without debugging.

Also, I am pretty sure now that if you do not see your C++ content in Unreal Editor, it is because their is a compilation issue which can be found in Visual Studio. If you create a new C++ class, and do NOT stop your debugging session, the C++ files will not show up in Visual Studio either. You may have to manually add the files into your Visual Studio project if you inadvertently overwrite the Unreal Editor changes.

Thanks:)
Its working

Thank you !

This happened to me when a project was started as a blueprint code type but then switched to C++ later. It seems that UE doesn’t automatically added that module to the .uproject file, but it fixes all sorts of various issues (like clicking on a parent class of a blueprint/asset and having the solution actually load the project instead of an empty Visual Studio with only that file, the Add Plugin feature in the editor supplying a full list of Plugin templates–as opposed to only the single “Blank Plugin” with a Blueprint project, etc.). Thank you for the solution!

This worked for me too! With Unreal 5.2. Thanks!

This helped me thanks!
I was converting a blueprint project to cpp but unreal didn’t recognize my classes. Triggering live coding would give me this error:
Unable to parse LiveCoding.json (missing LinkerPath field) which really led me astray.
Adding the project module to .project solved the problem :))

1 Like

In my case I had a class created that did not inherit from any other class. At some point, I decided I wanted it to inherit from AActor so I added the : public AActor in the class declaration.

Following this, it was not showing in the explorer and that was because in the .h file I had to add the UCLASS() tag at the top as well as the GENERATED_BODY() in the class.

1 Like

I fixed my issue by closing Unreal Engine and then compiling my code in VS. I guess it doesn’t recognize it until it is restarted. I was following the tutorial and thought something was wrong but it was just me being a noob. Hope this helps anybody.

What worked for me is just clicking the ‘Recompile’ button, and the missing C++ classes reappeared in the Content Browser.
In the log during compilation I noticed several messages saying "File <filePath>.cpp.obj was modified or is new".

3 Likes