# UE 4.2 Custom character movement component now crashes editor

**URL:** <https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [June 6, 2014, 1:28am UTC](https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590 "2014-06-06T01:28:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corillian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Corillian](https://forums.unrealengine.com/u/Corillian)\
**Post date:** [June 6, 2014, 1:28am UTC](https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590/1 "2014-06-06T01:28:47Z")

</div>

I have a custom ACharacter derived class, AMyChar, which also has a custom movement component UMyMovComp. The custom movement component overrides the default movement component as follows:

```auto

AMyChar::AMyChar(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP.SetDefaultSubobjectClass<UMyMovComp>(ACharacter::CharacterMovementComponentName))

```

Furthermore I have a blueprint, MyChar\_BP, which inherits from AMyChar and 2 additional blueprints, MyChar\_BP\_A and MyChar\_BP\_B, which both inherit from MyChar\_BP. When I click “Play” in the editor it then crashes because the game dynamically creates new instances of MyChar\_BP\_A and MyChar\_BP\_B which will have a NULL movement component. During editor startup I will get the following error:

```auto

[2014.06.06-01.08.22:561] 0]LogLinker:Error: Failed import: class 'CharacterMovementComponent' name 'CharMoveComp' outer 'Default__MyChar_BP_C'. There is another object (of 'MyMovComp' class) at the path.

```

This error is being logged at LinkerLoad.cpp line 3132 with the following stack trace:

```auto

UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::CreateExport(int Index) Line 3133	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::IndexToObject(FPackageIndex Index) Line 3363	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::operator<<(UObject * & Object) Line 3541	C++
UE4Editor-CoreUObject-Win64-Debug.dll!UObjectProperty::SerializeItem(FArchive & Ar, void * Value, int MaxReadBytes, const void * Defaults) Line 23	C++
UE4Editor-CoreUObject-Win64-Debug.dll!FPropertyTag::SerializeTaggedProperty(FArchive & Ar, UProperty * Property, unsigned char * Value, int MaxReadBytes, unsigned char * Defaults) Line 138	C++
UE4Editor-CoreUObject-Win64-Debug.dll!UStruct::SerializeTaggedProperties(FArchive & Ar, unsigned char * Data, UStruct * DefaultsStruct, unsigned char * Defaults) Line 1058	C++
UE4Editor-CoreUObject-Win64-Debug.dll!UClass::SerializeDefaultObject(UObject * Object, FArchive & Ar) Line 2994	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::Preload(UObject * Object) Line 2740	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::RegenerateBlueprintClass(UClass * LoadClass, UObject * ExportObject) Line 65	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::CreateExport(int Index) Line 3188	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::IndexToObject(FPackageIndex Index) Line 3363	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::operator<<(UObject * & Object) Line 3541	C++
UE4Editor-CoreUObject-Win64-Debug.dll!UClass::Serialize(FArchive & Ar) Line 2908	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::Preload(UObject * Object) Line 2746	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::CreateExport(int Index) Line 3234	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::IndexToObject(FPackageIndex Index) Line 3363	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::CreateExport(int Index) Line 3009	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::IndexToObject(FPackageIndex Index) Line 3363	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::CreateExport(int Index) Line 3009	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::CreateExportAndPreload(int ExportIndex, bool bForcePreload) Line 2426	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::LoadAllObjects(bool bForcePreload) Line 2501	C++
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 823	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2142	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::VerifyImport(int i) Line 1940	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2178	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::VerifyImport(int i) Line 1940	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::VerifyImportInner(const int ImportIndex, FString & WarningSuffix) Line 2178	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::VerifyImport(int i) Line 1940	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::Verify() Line 1727	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::FinalizeCreation() Line 1633	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::Tick(float InTimeLimit, bool bInUseTimeLimit, bool bInUseFullTimeLimit) Line 553	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ULinkerLoad::CreateLinker(UPackage * Parent, const wchar_t * Filename, unsigned int LoadFlags) Line 339	C++
UE4Editor-CoreUObject-Win64-Debug.dll!GetPackageLinker(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags, UPackageMap * Sandbox, FGuid * CompatibleGuid) Line 701	C++
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 784	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ResolveName(UObject * & InPackage, FString & InName, bool Create, bool Throw) Line 553	C++
UE4Editor-CoreUObject-Win64-Debug.dll!StaticLoadObject(UClass * ObjectClass, UObject * InOuter, const wchar_t * InName, const wchar_t * Filename, unsigned int LoadFlags, UPackageMap * Sandbox, bool bAllowObjectReconciliation) Line 655	C++
UE4Editor-MyUE4Game-Win64-Debug.dll!ConstructorHelpersInternal::FindOrLoadObject<UClass>(FString & PathName) Line 31	C++
UE4Editor-MyUE4Game-Win64-Debug.dll!ConstructorHelpers::FObjectFinder<UClass>::FObjectFinder<UClass>(const wchar_t * ObjectToFind) Line 91	C++
UE4Editor-MyUE4Game-Win64-Debug.dll!AMyGameMode::AMyGameMode(const FPostConstructInitializeProperties & PCIP) Line 17	C++
UE4Editor-MyUE4Game-Win64-Debug.dll!InternalConstructor<AMyGameMode>(const FPostConstructInitializeProperties & X) Line 2052	C++
UE4Editor-CoreUObject-Win64-Debug.dll!UClass::CreateDefaultObject() Line 2377	C++
UE4Editor-CoreUObject-Win64-Debug.dll!UObjectLoadAllCompiledInDefaultProperties() Line 507	C++
UE4Editor-CoreUObject-Win64-Debug.dll!ProcessNewlyLoadedUObjects() Line 576	C++
UE4Editor-CoreUObject-Win64-Debug.dll!TBaseStaticDelegateInstance_NoParams<void>::Execute() Line 812	C++
UE4Editor-CoreUObject-Win64-Debug.dll!TBaseStaticDelegateInstance_NoParams<void>::ExecuteIfSafe() Line 823	C++
UE4Editor-Core-Win64-Debug.dll!TBaseMulticastDelegate_NoParams<void>::Broadcast() Line 1815	C++
UE4Editor-Core-Win64-Debug.dll!FModuleManager::LoadModuleWithFailureReason(const FName InModuleName, ELoadModuleFailureReason::Type & OutFailureReason, const bool bWasReloaded) Line 379	C++
UE4Editor-Projects-Win64-Debug.dll!FProjectOrPlugin::LoadModules(const ELoadingPhase::Type LoadingPhase, TMap<FName,enum ELoadModuleFailureReason::Type,FDefaultSetAllocator,TDefaultMapKeyFuncs<FName,enum ELoadModuleFailureReason::Type,0> > & ModuleLoadErrors) Line 28	C++
UE4Editor-Projects-Win64-Debug.dll!FProjectManager::LoadModulesForProject(const ELoadingPhase::Type LoadingPhase) Line 86	C++
UE4Editor-Win64-Debug.exe!FEngineLoop::LoadStartupModules() Line 1723	C++
UE4Editor-Win64-Debug.exe!FEngineLoop::PreInit(const wchar_t * CmdLine) Line 1302	C++
UE4Editor-Win64-Debug.exe!EnginePreInit(const wchar_t * CmdLine) Line 32	C++
UE4Editor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE __* hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 111	C++
UE4Editor-Win64-Debug.exe!WinMain(HINSTANCE __* hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 196	C++

```

To summarize the classes for the 2 leaf blueprints, MyChar\_BP\_A and MyChar\_BP\_B, are being loaded in the constructor for AMyGameMode which causes ULinkerLoad::RegenerateBlueprintClass() to be called and ultimately results in the crash. The AMyGameMode constructor loads the classes as follows:

```auto

static ConstructorHelpers::FObjectFinder<UClass> team0BPClass(TEXT("Class'/Game/Blueprints/MyChar_BP_A.MyChar_BP_A_C'"));
static ConstructorHelpers::FObjectFinder<UClass> team1BPClass(TEXT("Class'/Game/Blueprints/MyChar_BP_B.MyChar_BP_B_C'"));

this->DefaultTeam0Class = team0BPClass.Object;
this->DefaultTeam1Class = team1BPClass.Object;

```

All of this worked fine in UE 4.1 so any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [June 6, 2014, 1:31am UTC](https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590/2 "2014-06-06T01:31:36Z")

</div>

Very detailed post, and congrats on your first post!

**Welcome to the forums Corrillian!**

I hope Epic can get back to you on this one!

Rama

---

<div class="post-metadata">

**Author:** ![Corillian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Corillian](https://forums.unrealengine.com/u/Corillian)\
**Post date:** [June 12, 2014, 10:52pm UTC](https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590/3 "2014-06-12T22:52:02Z")

</div>

Here is a fix. Change LinkerLoad.cpp line 3130 from:

```auto

if (ActualObjectWithTheName && (ActualObjectWithTheName->GetClass() != LoadClass))
		{
			UE_LOG(LogLinker, Error, TEXT("Failed import: class '%s' name '%s' outer '%s'. There is another object (of '%s' class) at the path."),
				*LoadClass->GetName(), *Export.ObjectName.ToString(), *ThisParent->GetName(), *ActualObjectWithTheName->GetClass()->GetName());
			return NULL;
		}

```

To:

```auto

if (ActualObjectWithTheName && (ActualObjectWithTheName->GetClass() != LoadClass))
		{
			if(ActualObjectWithTheName->GetClass()->IsChildOf(LoadClass))
			{
				LoadClass = ActualObjectWithTheName->GetClass();
			}
			else
			{
				UE_LOG(LogLinker, Error, TEXT("Failed import: class '%s' name '%s' outer '%s'. There is another object (of '%s' class) at the path."),
					*LoadClass->GetName(), *Export.ObjectName.ToString(), *ThisParent->GetName(), *ActualObjectWithTheName->GetClass()->GetName());
				return NULL;
			}
		}

```

local var Template already points to the overridden component class so the rest of the code seems to just work.

---

<div class="post-metadata">

**Author:** ![Timbo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Timbo](https://forums.unrealengine.com/u/Timbo)\
**Post date:** [July 7, 2014, 12:14am UTC](https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590/4 "2014-07-07T00:14:10Z")

</div>

Thx Corillian!

I had the same problem.

---

<div class="post-metadata">

**Author:** ![dragn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dragn](https://forums.unrealengine.com/u/dragn)\
**Post date:** [July 16, 2014, 9:24pm UTC](https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590/5 "2014-07-16T21:24:25Z")

</div>

Some good guy (GeekyPayback) added commentary on wiki page [A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums](https://wiki.unrealengine.com/Custom_Character_Movement_Component) (see Addendum) stating that you need to recreate blueprint to avoid this error! It worked for me!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [July 17, 2014, 1:34am UTC](https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590/6 "2014-07-17T01:34:06Z")

</div>

This issue is fixed in 4.3, so that my original wiki code works again 🙂

Let me know if anyone has any issues still!

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

And thank you to whoever added the Addendum!

Rama

---

<div class="post-metadata">

**Author:** ![AleMarcati](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alemarcati/32/1139690_2.png) [@AleMarcati](https://forums.unrealengine.com/u/AleMarcati)\
**Post date:** [June 1, 2022, 2:47pm UTC](https://forums.unrealengine.com/t/ue-4-2-custom-character-movement-component-now-crashes-editor/5590/7 "2022-06-01T14:47:42Z")

</div>

I’m having the same problem in UE 5.0.2. If I add a constructor to my custom Movement Component, UE crashes.  
Anyone else?
