1
\$\begingroup\$

I created a new C++ project on Unreal Engine 4. After that I close visual studio and ue4 editor. I manually added public and private folders in the source folder. Then I made folders for the player, items, AI and gamemodes.

The problem appears when I create a new class, the files appear in the respective folders but not in the editor. To fix this I open the visual studio project and I press the build solution. I restart the editor and the classes appear in the folder structure.

The real problem starts here. When i double click any class. A new visual studio appears, ue4 shows the progress bar on the bottom right corner with the text "Loading visual studio". After a couple of seconds a new visual studio pops up. A new screen appears saying that the project is opened on another visual studio and now will migrate all info to a temp folder.

Now I can't code because any attempt at using a C++ class by dragging it into the editor viewport instantly crashes UE4.

What am I doing wrong? What is the correct workflow for creating folder structures in UE4? There is no documentation on how to do this properly.

\$\endgroup\$
2
\$\begingroup\$

Always create the folders in the Unreal editor by right clicking in the directory tree and selecting New Folder or clicking the green "Add New" bar at the top.

Unreal itself creates the public and private folders, when creating a new asset / actor / function etc. you choose the public or private options.

Public Private Folder Selection Unreal Engine

When you are creating them, click the relevant box but note that only one of the C++ files goes into the folder you clicked. I forget which one but either the header or cpp file always goes into the private folder.

The only thing I can suggest is right clicking on any of your folders and choosing the "Fix Up Redirectors In Folder" which should bring up the option to do this for all folders which hopefully, will fix your problems.

One other issue is that Visual Studio may need the full location of the files it's using, either by putting them in the #include section (ie "public/items/items.h" or putting them in the included directories from the editor Project settings.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.