# Packaged game crashes

**URL:** <https://forums.unrealengine.com/t/packaged-game-crashes/297941>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 2, 2014, 12:35pm UTC](https://forums.unrealengine.com/t/packaged-game-crashes/297941 "2014-11-02T12:35:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [November 2, 2014, 12:35pm UTC](https://forums.unrealengine.com/t/packaged-game-crashes/297941/1 "2014-11-02T12:35:57Z")

</div>

Hi,

My game works fine in the editor (even when launched as a standalone game).

But when i package it, i get a crash with a message pointing to those lines in my code:

```
// Dice declaration
static ConstructorHelpers::FObjectFinder<UBlueprint> BP_d4Object(TEXT("Blueprint'/Game/dice/D4_Dice_BP.D4_Dice_BP'"));
BP_d4 = (UClass*)BP_d4Object.Object->GeneratedClass;

```

They are in the constructor of a ACharacter derived class, nothing fancy.

The crash reporter says the last line is guilty of access violation.

I guess somehow the object can’t be reached in packaged game, while it’s there in the editor.

But then what can i do ?

BTW im in 4.5 and it’s the first time i try to package.

Thanks

Cedric

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [November 2, 2014, 1:10pm UTC](https://forums.unrealengine.com/t/packaged-game-crashes/297941/2 "2014-11-02T13:10:32Z")

</div>

Maybe those lines are not guilty: i tried to comment them and i get a crash pointing in some other line in the constructor:

```
	CharacterMovement->SetMovementMode(MOVE_Falling, 0);

```

This time, there isn’t any BP involved, it’s a safe line (at least i hope), but the error is the same (access violation), only with a different line number.

By the way, this is my default class pawn in case it’s important: i suppose it’s loaded in memory early in the game ? Could all those properties be not present at startup in the packaged game ?

I am no c++ (neither ue4) guru. Maybe those things should be in the beginplay function and not in the constructor ?

Should i leave in the constructor only what concerns the editor like BP stuff ?

I have aldready packaged BP games with no problem, this is my first c++ game, so maybe there are some packaging option that i missed ?

Cedric

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [November 2, 2014, 4:17pm UTC](https://forums.unrealengine.com/t/packaged-game-crashes/297941/3 "2014-11-02T16:17:33Z")

</div>

oups, mistake in my previous post.

The access violation was pointing here:

```
static ConstructorHelpers::FObjectFinder<UBlueprint> BP_YagCharacterObject(TEXT("Blueprint'/Game/Character/BP_YagCharacter.BP_YagCharacter'"));
BP_YagCharacter = (UClass*)BP_YagCharacterObject.Object->GeneratedClass;

```

This time it’s in the playercontroller contructor.

So obviously there is a problem with objects generated from BP, which is a good news, at least it’s not random.

Is there anything special to check when packaging a game using this kind of code ?

Continuing my tests

Cedric

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [November 2, 2014, 4:39pm UTC](https://forums.unrealengine.com/t/packaged-game-crashes/297941/4 "2014-11-02T16:39:04Z")

</div>

Ok, problem solved.

In the DefaultEditor.ini, i had this:

```
bDontLoadBlueprintOutsideEditor=true

```

and i replaced it by this:

```
bDontLoadBlueprintOutsideEditor=false

```

Not sure this is a good idea to let that one to true by default when creating a project.

Cedric
