Player Controller keeps corrupting and crashing my engine when restarting

Hello!

First off, i am new to unreal and coding, and have no idea how C++ works. I have been following a tutorial on how to make a multiplayer game, and at some point my editor would crash after loading up the project again. I moved BPs in and out of the project to see what was crashing it, and found that when removing the player controller it would start up again, and when i put it back in it would crash. So naturally i looked up stuff online and found something saying to rename the files to recreate file pathing and it worked! At least for a while it did.

That was a couple weeks ago, now i have the same problem where it crashed again, so i renamed it and tried again, and it loads up without crashing, but also doesn’t load the controller into the project at all, like it doesn’t exist.

My personal prediction is this is some kind of file pathing problem, but i don’t really know for sure.

This battle between me and the controller is getting kinda old pretty quick, so I’m hoping that someone smarter than me can give me some insight on what is going on so i can hopefully put all of these issues to rest.

(Side notes: I keep backups of my project stored on my computer on the same drive but in different folders, I’m not sure if that matters but i thought i should say it. Also crashes are inconsistent but i can try to make a crash happen if the log is needed)

1 Like

I think it might be due to the player controller having a C++ class parent and you’re trying to launch the project before it could be compiled properly. How do you launch the editor? Do you build your project from VS?

1 Like

I launch my project from my file explorer by clicking on the .uproject and then it loads up unreal engine editor, and no i don’t load up my project from VS ( That would be Visual Studio right?)

1 Like

You should get used to building your project via VS if you’re working with C++. Instead of the .uproject file, open up the .sln file and once it loads, hit Ctrl + F5 (or alternatively you can click on that green play icon) to build your project.

If the issue persists, that means there’s a corruption and you should be able to fix it by deleting all VS related files (the .vs folder, Source folder and the .sln file) and regenerating them by opening up your .uproject file, navigating to the Tools menu, and from there creating a new C++ class. While you’re creating a new C++ class, also select the option to make it Public to generate the Public and Private folders automatically. Once that’s done, close the editor, head back to your project directory, navigate to the newly generated Source folder, under there navigate to the folder with your project name on it, and there you’ll see two folders named Public and Private. You can replace them with the original ones (as they’ll be empty) and hopefully everything will be fixed once you build your project via VS.

Disclaimer: Always make sure to have backup(s) of your project before manually adjusting the project files!!!

1 Like

I don’t work with C++ I’ve only been using blueprints and nodes for the entirety of this project but i would like to learn it one day as it seems helpful for situations like this. If this seems like the only fix, i can create another backup and try to do it this way

1 Like

I see. Since you mentioned C++ in your original post, I assumed that the issue was about one of your blueprints having a C++ class parent and it not being compiled properly before the editor could launch.

You might want to create a blank project and migrate your assets & blueprints to the new project to see if you encounter the same thing there as well.

1 Like

I’m not sure how i would migrate the controller into another project as it doesn’t show up at all in the editor. I can copy the files from one project to another if that would still work

1 Like

Avoid manually adjusting the project files unless it’s necessary. You can simply migrate your assets & blueprint by right clicking on them, navigating to the Asset Actions section on the menu that pops up, and choose the Migrate option which should appear once you hover on that section. You can also choose a folder as a whole and the Migrate option won’t be hidden under any additional menus in that case. Then you can choose your new blank project as their new home :innocent:


Also, you can always create a new player controller blueprint either in your current project or in the new project that you migrate your assets to.

1 Like

I tried to migrate my “Multiplayer” folder that contains all of the multiplayer stuff (including the controller), and it crashed and came up with this error: ActorsByGuid.Remove(ActorDesc->GetGuid()) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\WorldPartition\ActorDescList.cpp] [Line: 59]

I do believe i could make another Player Controller BP to fix this problem, but I’m not confident it would fix this in the long term as I’ve had it corrupt multiple times and it only fixed when i would rename the file. (Also it would take a while to change all the references again but i suppose it wouldn’t be too bad)

I suppose what I’m most worried about is the way i store my backups for my project. Is copy and pasting projects and keeping them in separate folders making the file pathing mess up? Or is something actually corrupted and needs to be erased/changed? Just thinking out loud here

1 Like

It seems like there are additional things you need to migrate.

No, manually copying project folders would not cause such issues. But external things wouldn’t be able to access it such as version control that way and you’d need to reset those as well. But simply copying your project folder wouldn’t cause any corruptions. If you manually change any file names inside the project directory however, then yes, that would break things.

I do not how to format multiple responses like you did, so I’m gonna respond this way instead:

Q1: I migrated my entire content folder into the new project to make sure no dependencies were lost, it got to 100 percent and crashed when it finished, giving the same error as before. That being said the files did actually migrate into the blank project, but the controller still didn’t appear in the file it should be in.

Q2: So if i were to take a blueprint out of a project, rename it in the file explorer(or in the project files), and put it back in, that would cause issues right?

Like I said, try creating a new one but this time don’t rename any project files manually. Don’t do anything inside the project directory if you’re not completely sure what you’re doing.

You can access the project directory via File Explorer. I didn’t get what do you mean by “or” there.

Absolutely! You should not rename your assets manually from the project folder!!! You can already adjust their name and location inside the editor!

What i did was migrate the entire content folder and move it to a brand new project, i didn’t rename any files before or after but the controller that is broken was included in that migration since it is still in the files (as you will read later, i renamed this controller in the past so that might be why its broken)

I mean editing the name in the file path for the project or editing it after copying it elsewhere, i should have clarified that lol but now i know that either method is bad

So what is super weird about this is renaming the file while in file explorer is actually what helped me solve the original problem that i had weeks before this one ( i sort of mentioned that in the original post but i didn’t clarify that).
I couldn’t open the project because it kept crashing so i couldn’t change the name in editor. I probably ended up breaking more stuff in the long run by doing that, so it might be best to cut my losses and re-create my controller from a brand new one or something of that sort, what do you think would be the best call here? I do have backup projects that work, and they have older versions of my controller that aren’t too old.

Also here is the post i found that said to rename it, i didn’t know better and renamed it in file explorer: Blueprints keep corrupting

That’s great! You should always choose to revert back to an older version of your project when something like that happens. You can just copy paste your blueprint code between your projects to bring your progress to the older version without needing to migrate anything!

Additionally, it seems like you’re copying your project at milestones. You can consider connecting a version control to your project for convenience. Don’t get me wrong, do keep having those kind of backups too! But you just don’t need to have the whole history of your project as copies.

Well looks like i have some work to do, but what exactly do you mean by version control? Is that some sort of app i can install to manage projects?

Here’s a tutorial on it :innocent:

Oh thanks for the link! Also for the purposes of wrapping up this post I’m gonna mark it as solution found but i really appreciate the help and patience you’ve had for me, i will certainly try to be more careful with files in the future.

(Edit: I actually am still running into some problems but I’m gonna troubleshoot some more before asking for help again)

Ok i solved my problem, what i did was slowly fix a reference to my controller, compile and save, close editor, and repeat until all references are done and the controller seems to work now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.