.cpp file missing in editor

I tried that and it didn’t work. they were created inside the engine itself and the engine said there was an error in generating the files, but in VS they are there, and have the basic generated code of #includes and everything. Luckily it was my first 2 C++ classes of the project so I made a new one created them and transferred over my content folder. But I will definitely need to know how to fix this if it happens in a project much farther along.

So I have created 1 class which is the TankPlayerController which points to a pawn that’s a Tank and in the visual studio solution the header and cpp file are there, but in the engine editor it isn’t. And the compiler is failing because the engine is not seeing the tank files. How do I fix this? I have tried shutting down the editor vs and reopening as others have said and have tried rebuilding the solution and engine by removing all delegates and rebuilding and it still is not picking up my other class.

Right click the .uproject and select “Generate Visual Studio Project files”.

See if that helps.

If you add any code from outside of the editor, you will need to generate the visual studio project files in order for the project to know of them.

I’m new, and this is based off troubleshooting the same issue I’m having…but it seems that classes that do not inherit from an Unreal type cannot be seen in the unreal engine. However, you can still use them in code.

Example:

  • You have two classes, Tank, one inherits from pawn and will be used as your default player.
  • You have another class, Ammunition, which inherits from nothing (or at least not an unreal class type), and will be the tank’s type of ammunition (standard, incendiary, explosive, armor piercing).

You will not be able to see Ammunition in the editor. However, your tank could have an Ammunition class as a field.