8

Whenever I exit the Unreal Engine 5 editor, I've noticed that when I open it up again, my various C++ classes disappear.

Fortunately, all I have to do is re-compile and they will be added back in again. However, it does become a serious inconvenience since I will have to re-attach it to any actors it was a component of and I have to re-do any Detail panel edits I did.

Let's say I'm trying to make a series of moving platforms move for my parkour game, so I make an ActorComponent called PlatformMover. I attach it to different platforms with their own velocities and directions. I then exit the Editor for the day and when I re-open it the next day, PlatformMover is gone. I then re-compile my project and PlatformMover is back, but I now have to re-attach it and re-configure it for every platform again.

It's really inconvenient, so is there any fix for this?

jovandl
  • 183
  • 2
  • 6
  • That really sounds terribly inconvenient. There have been multiple reports of [similar issues on the forums](https://forums.unrealengine.com/t/c-classes-disappearing/55942). One of them was an [accidental deletion of the module description](https://forums.unrealengine.com/t/c-classes-disappearing/55942/17?u=blurryroots). There is also [this discussion on reddit about disappearing classes](https://www.reddit.com/r/unrealengine/comments/tv6xt5/my_c_classes_are_disappearing_in_the_editor_after/). – blurryroots May 27 '22 at 20:52
  • Thanks for the advice! From the forums you sent, the advice of "Closing the editor then cleaning, rebuilding it from the IDE" was able to solve the issue. Unfortunately, they only resolve the issue and I have yet to find anything that prevents this from happening. I have tried to recreate the issue, and it still persists. It's a lot better, of course. I just now have to do this routine in my IDE every now and then, but I kind of miss the convenience of just closing my editor with peace of mind. – jovandl May 28 '22 at 01:49
  • Glad to hear that this made things slightly better. Although it still sounds painful to have to rebuild the project every time. I'd recommend checking out the latest version of the engine as well. Maybe this was a known issue, which has been fixed with the most recent release. – blurryroots May 28 '22 at 08:19
  • 1
    No worries @blurryroots I actually managed to find a solution that I have now written down in the post. A huge error of mine was basically using the wrong build task in my IDE. – jovandl May 28 '22 at 08:59

1 Answers1

10

I managed to find out that this is a rather common bug with live coding. Fortunately, the Unreal Engine course I've been taking actually has a video earlier in the course catalog that deals with this, and I can report that the solution provided worked for me.

  1. Close the editor immediately but leave the IDE open.
  2. Build the code with [Project Name]Editor Win64 Development Build. (Emphasis on the "Editor" part at the end. I thought this didn't work until I realized that I was actually using "[Project Name] Win64" instead of "[ProjectName]Editor Win64"
  3. Open the project again.
jovandl
  • 183
  • 2
  • 6
  • Worked for me with unreal 5.0.2 – ANimator120 Nov 07 '22 at 17:50
  • In my case I just needed to build at least once from the IDE (I am using Rider). I had been coding using the live reload and had only built the project using the Unreal Editor's compile button and had closed the editor. – JeffSpicoli Jan 02 '23 at 01:15