Why can't delete the c++ class from content browser?

hi guys,im new to unreal ,and recently i find a problem that when i want to delete a c++ class added by “Add Code to Project” from the content browser, i just find the “delete” option in grey color, so how can i fix it?? thanks in advanced

As far as I know, to delete a c++ class find the folder that it is stored in on your computer and delete the file manually, then delete it from the solutions explorer in your IDE. When you restart Unreal it will reload your classes into the editor the c++ file you deleted should be gone.

but since in content browser has a “delete” option , it should be able to delete it from content browser directly so that i dont have to do these step…but i dont know why the “delete” option is in grey =_=!

anyway ~ thanks a lot :slight_smile:

Yeah, I know what you mean xD. I ran into this problem a couple days ago and the best answer I could find was the one I gave you. Maybe someone has a better solution.

It doesnt work ( for me ) - the Unreal Editor do not delete the compiled files and block the used names.

Yeah its the .obj file made by VS that is making it appear in the UE. After you have removed the .h and cpp from your VS project, ‘Build > Clean Solution’ in VS to get rid of it.

2 Likes

+1 for this. This is the only solution that worked for me too. Thanks.

The true is, Delete from windows explorer, and find your .uproject file , right click, choose “Generate Visual Studio project files”

Only this solution did work for me though

PS. dont look at all the conversation just scroll down to the accepted answer.