Removing .h / .cpp Files

I’m extremely new to UE4 so forgive me for what seems to be a simple question…How do I alter .h / .cpp files that I’ve added to the project via File → Add Code To Project? I’ve tried deleting them or modifying them via VS2013 but that clearly does not work even after I re-compile the entire thing after removing said files. If I try to alter the file names or whatnot it probably wouldn’t work either so how do I do these simple operations when I can’t do it as I normally would via VS2013?

Thanks for your time.

I can highly recommend the workflow of adding .h and .cpp files externally in the OS browser directly, creating them using your favorite IDE.

VS and the Unreal Build Tool will find them just fine as long as they are in the right directory structure and have the right headers.

I personally have never once used ->Add Code to Project in the Editor

I hope someone else can answer your actual question tho :)


I agree with Rama. I too have never used the “Add code to project” feature. Just make sure that newly created files go into the right directory (Not the default immediate directory) Otherwise UBT won’t see them

Ah, ok, I see exactly what’s going on now. VS2013 by default will add the files into the …\Intermediate\Project Files\ directory, which is the incorrect location. When deleting those files, VS2013 will check to make sure they aren’t in the …\Intermediate\Project Files\ directory before removing it from the solution view inside of VS2013 (if it does find those files at that location, it will delete them. If it can’t find it it’ll act as if the files were deleted even though they weren’t!). It doesn’t check the other location so when I’d refresh the solution via UE4, the code re-appears as it should.

Thanks for your help guys.