Unreal engine started crashing after changing the name of a Subobject

Hello everyone!

I m getting this crash

after changing the name of the SkeletalMesh subobject to Arms (I previously had it on FPArms)

This is the getSkeletalMesh getter and this is the line of code that is causing problems.


I had this happened again in the past and it worked by commenting the object that was causing the issue then compiling, uncoomenting and compiling again. Now this doesnt work…

I m happy to provide adittional info if you need it.


this is the lines of code that the crash is reffering to

Thanks in advance!

Have you tried to rebuild the solution in your text editor, prior to opening up the project?

Sometimes compiling the code will work (as far as the compiler goes), but it will cause the editor to crash. As the project reloads that code, it continues to crash until the code is rebuilt.

EDIT:

Actually… it doesn’t look like you are setting the “SkeletalMesh” variable in BeginPlay, so it is referencing a nullptr. You need to set that prior to accessing it by using this->GetMesh();

Sometimes messing with components in C++ or header files can corrupt blueprints. You can usually tell if a component is corrupted if you click on it and the details panel is completely empty (like the third screenshot you’ve shown). There’s a few options you can try:

  1. Try renaming the component back to its old name

  2. Try changing the name of the variable (IE from SkeletalMesh to SkeletalMesh2)

  3. Try creating a new child blueprint class of your C++ class.

  4. Use your source control to revert the file back to its old state before you edited the component (highly advise setting this up for this reason if you haven’t already)

You can see my other thread where I experienced the same issue and resolved it by doing option 2

Generally, I advise doing a recompile and rerun the editor rather than a hot reload if you ever mess with components or header files as it can cause these issues (though im not saying that’s why it happened).

Definitely second this^. Any changes to the header/constructors, you should close the UE editor, compile the code in your text editor, then reopen the UE editor.

GetMesh() uses the default subobject when you are creating a character this is a new subobject no? Am I tripping?
Also what do you mean setting this the skeletalMesh? I do this in BP_PlayerCharacter


but now as you can see its not showing anything

I m trying now the second option
The third options works but I have BP code in it and it will go to waste

Yes 2nd this worked

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