# CDO Constrcutor failed to find WidgetBlueprint

**URL:** <https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468>\
**Category:** UI\
**Tags:** hud, cdo, packaging-and-cookin, unreal-engine, question, Blueprint\
**Created:** [March 23, 2016, 10:52am UTC](https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468 "2016-03-23T10:52:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomgn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomgn](https://forums.unrealengine.com/u/tomgn)\
**Post date:** [March 23, 2016, 10:52am UTC](https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468/1 "2016-03-23T10:52:22Z")

</div>

Hi,

in my GameMode.cpp I load a WidgetBlueprint as follows:

```
static ConstructorHelpers::FObjectFinder<UBlueprint> Blueprint2(TEXT("WidgetBlueprint'/Game/StarterContent/custom/widget/HUDWidget.HUDWidget'"));

	widgetClass = (UClass*)Blueprint2.Object->GeneratedClass;

```

widgetClass is a TSubclassOf member of my GameMode and will be used later to display my HUD.

Starting the game in the editor works fine, but when i package the game (in my case win64) and try to execute it, it crashes without an error message.  
So i checked the .log file, which includes the following:

```
[2016.03.23-10.31.34:275][0]Error: CDO Constructor (ICGameMode): Failed to find WidgetBlueprint'/Game/StarterContent/custom/widget/HUDWidget.HUDWidget'
[2016.03.23-10.31.34:431][0]LogWindows:Error: === Critical error: ===
Fatal error!

```

I’ve already done some research and found suggestions like loading the UClass directly ([here](https://answers.unrealengine.com/questions/84880/cdo-constructor-failed-to-find-blueprint-ue-44.html)) instead of the Blueprint which looks something like this:

```
static ConstructorHelpers::FObjectFinder<UClass> Blueprint2(TEXT("Class'/Game/StarterContent/custom/widget/HUDWidget.HUDWidget'"));
widgetClass = (UClass*)Blueprint2.Object;

```

Another suggestion was to manipulate a DefaultEditor config file with the following:

```
bDontLoadBlueprintOutsideEditor=false

```

Because none of them are working for me I wanted to ask if anybody knows another solution for this problem.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 23, 2016, 7:56pm UTC](https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468/2 "2016-03-23T19:56:04Z")

</div>

Hello tomgn,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

1. Can you reproduce this issue in a clean project?
2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
3. Could you provide the code to any C++ classes that may be involved with this issue?

---

<div class="post-metadata">

**Author:** ![tomgn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomgn](https://forums.unrealengine.com/u/tomgn)\
**Post date:** [March 24, 2016, 5:42pm UTC](https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468/3 "2016-03-24T17:42:13Z")

</div>

Hi,

yes I can reproduce it.  
my Steps are:

- Start the Editor through the Epic Games Launcher and select a blank C++ Project without Starter Content.

- Rightclick in the Content Browser and create a Widget Blueprint, name it ‘widget1’. Then open it and place a button right at the center of the screen. Save and close it.

- Create two new C++ Classes in the Editor. One with the parent class “Player Controller” called MyPlayerController - the other one with the parent class “Pawn” called MyPawn

- Open the Project Settings and set the TestProjectGameMode as default - save project.

- Adjust the dependencies, so that UMG can be used:

TestProject.Build.cs:

```
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG" });
PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

```

- Extend the TestProjectGameMode C++ Class so that it contains the following:

→ post is to long, please see the next comment!

I think that’s all and I don’t forgot a step. If I start the Game in the Editor, it will run without problems and it will even display the button. This tells me that the WidgetBLueprint was loaded successfully.  
I can package the game also without errors, but when I’m trying to start the game as a win64 .exe, it crashes and the log file contains the same error message as mentioned above in my question.

---

<div class="post-metadata">

**Author:** ![tomgn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomgn](https://forums.unrealengine.com/u/tomgn)\
**Post date:** [March 24, 2016, 5:42pm UTC](https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468/4 "2016-03-24T17:42:42Z")

</div>

TestProjectGameMode.h

```
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once
#include "Blueprint/UserWidget.h"
#include "GameFramework/GameMode.h"
#include "TestProjectGameMode.generated.h"

/**
*
*/
UCLASS()
class TESTPROJECT_API ATestProjectGameMode : public AGameMode
{
	GENERATED_BODY()

		ATestProjectGameMode();

	UPROPERTY(EditAnywhere, Category = "creator")
		TSubclassOf<UUserWidget> widgetClass;

	UPROPERTY(EditAnywhere, Category = "widget")
		UUserWidget* CurrentWidget;

	void ChangeMenuWidget(TSubclassOf<UUserWidget> NewWidgetClass);

	virtual void BeginPlay() override;
};

```

TestProjectGameMode.cpp:

```
// Fill out your copyright notice in the Description page of Project Settings.

#include "TestProject.h"

#include "MyPawn.h"
#include "MyPlayerController.h"

#include "TestProjectGameMode.h"

ATestProjectGameMode::ATestProjectGameMode() {
	UWorld* const World = GetWorld();

	DefaultPawnClass = AMyPawn::StaticClass();
	PlayerControllerClass = AMyPlayerController::StaticClass();

	static ConstructorHelpers::FObjectFinder<UBlueprint> Blueprint(TEXT("WidgetBlueprint'/Game/widget1.widget1'"));
	widgetClass = (UClass*)Blueprint.Object->GeneratedClass;
	
}

void ATestProjectGameMode::BeginPlay()
{
	Super::BeginPlay();
	ChangeMenuWidget(widgetClass);

}

void ATestProjectGameMode::ChangeMenuWidget(TSubclassOf<UUserWidget> NewWidgetClass)
{
	if (CurrentWidget != nullptr)
	{
		CurrentWidget->RemoveFromViewport();
		CurrentWidget = nullptr;
	}
	if (NewWidgetClass != nullptr)
	{
		CurrentWidget = CreateWidget<UUserWidget>(GetWorld(), NewWidgetClass);
		if (CurrentWidget != nullptr)
		{
			CurrentWidget->AddToViewport();
		}
	}
}
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 30, 2016, 9:01pm UTC](https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468/5 "2016-03-30T21:01:45Z")

</div>

Hello tomgn,

I was able to reproduce this issue on our end. I have written up a report (UE-28930) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for you time and information.

Make it a great day

---

<div class="post-metadata">

**Author:** ![NickDarnell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NickDarnell](https://forums.unrealengine.com/u/NickDarnell)\
**Post date:** [April 4, 2016, 3:13pm UTC](https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468/6 "2016-04-04T15:13:04Z")

</div>

You can’t load blueprints at runtime, just their classes. Blueprints are an editor only time feature, they are not included in the packaged game.

---

<div class="post-metadata">

**Author:** ![ShadowSprite123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Post date:** [June 11, 2023, 10:58am UTC](https://forums.unrealengine.com/t/cdo-constrcutor-failed-to-find-widgetblueprint/351468/7 "2023-06-11T10:58:04Z")

</div>

But why can you do this with animation blueprints tho?
