# Crashing when using ConstructorHelpers

**URL:** <https://forums.unrealengine.com/t/crashing-when-using-constructorhelpers/6726>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [June 27, 2014, 2:06am UTC](https://forums.unrealengine.com/t/crashing-when-using-constructorhelpers/6726 "2014-06-27T02:06:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hagg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hagg](https://forums.unrealengine.com/u/Hagg)\
**Post date:** [June 27, 2014, 2:06am UTC](https://forums.unrealengine.com/t/crashing-when-using-constructorhelpers/6726/1 "2014-06-27T02:06:54Z")

</div>

I am trying to change my character’s chest mesh during run time using the ConstructorHelper::FObjectFinder but, the Editor crashes whenever I make the call.

Line causing the crash:

```auto

static ConstructorHelpers::FObjectFinder<USkeletalMesh> currentMesh(TEXT("SkeletalMesh'/Game/CC_Sentinal_Armor/Models/Chest_Model.Chest_Model'"));

```

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ccd38332](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ccd38332](https://forums.unrealengine.com/u/anonymous_user_ccd38332)\
**Post date:** [June 27, 2014, 8:24am UTC](https://forums.unrealengine.com/t/crashing-when-using-constructorhelpers/6726/2 "2014-06-27T08:24:50Z")

</div>

Although I’m not sure, I think the ConstructorHelpers can only be called int the constructor function, at the top of your cpp files, it should look like this :

AYourClass::AYourClass(const class FPostConstructInitializeProperties& PCIP)  
: Super(PCIP)  
{  
}

If you want to change your mesh at runtime (I m just guessing here), maybe you should store a reference for your different mesh in the character, and spawn them with SpawnActor when you need to change?

---

<div class="post-metadata">

**Author:** ![Hagg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hagg](https://forums.unrealengine.com/u/Hagg)\
**Post date:** [June 27, 2014, 12:32pm UTC](https://forums.unrealengine.com/t/crashing-when-using-constructorhelpers/6726/3 "2014-06-27T12:32:55Z")

</div>

That was my fear. Unfortunately I want to store the mesh names in a database and switch to the mesh when the armor piece (Chest/Legs/Head/Etc) is equipped. Does anyone know how I can accomplish dynamic mesh changing during run time?

---

<div class="post-metadata">

**Author:** ![Mark\_James\_G](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mark\_James\_G](https://forums.unrealengine.com/u/Mark_James_G)\
**Post date:** [June 27, 2014, 11:24pm UTC](https://forums.unrealengine.com/t/crashing-when-using-constructorhelpers/6726/4 "2014-06-27T23:24:26Z")

</div>

> **[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...

Try this.

---

<div class="post-metadata">

**Author:** ![Michael\_Noland](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/michael_noland/32/1194689_2.png) [@Michael\_Noland](https://forums.unrealengine.com/u/Michael_Noland)\
**Post date:** [June 28, 2014, 12:17am UTC](https://forums.unrealengine.com/t/crashing-when-using-constructorhelpers/6726/5 "2014-06-28T00:17:44Z")

</div>

Heya,

I’d suggest avoiding raw string references if at all possible; they don’t work with the cooker and are extremely fragile due to renames/typos/etc… Have a look thru this documentation: [Asynchronous Asset Loading | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/Programming/Assets/AsyncLoading/index.html) and see if you can make use of TAssetPtr instead.

Cheers,  
Michael Noland
