UE4 can't find blueprint

I made a CameraShake blueprint for a head bobbing motion on my player camera and in my player character class I did this:

AdNoctvmPlayerCharacter.h

UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category=Camera)
	class UCameraShake* CameraBob;

In the constructer in AdNoctvmPlayerCharacter.cpp

static ConstructorHelpers::FObjectFinder<UCameraShake> CameraBobOb(TEXT("/Game/Blueprints/Blueprint_CameraBob"));
	CameraBob = CameraBobOb.Object;

It compiles, but when I open the editor, I get this error message:

Default Property warnings and errors:
Error: CDO Constructor: Failed to find /Game/Blueprints/Blueprint_CameraBob

I have no idea what I did wrong. I made sure there was no typo in the path name and just to be extra sure, I went into my player character blueprint and tried referencing Blueprint_CameraBob in there, but the editor won’t find it/accept it. Both the variable CameraBob and the blueprint inherit from UCameraShake. I’m really lost here.

Hi vibgyorc6,

Have you tried using this line?

static ConstructorHelpers::FObjectFinder<UCameraShake> CameraBobOb(TEXT("Blueprint'/Game/Blueprints/Blueprint_CameraBob.Blueprint_CameraBob"));

It still doesn’t work. I compiled it with that line and the editor crashed when I tried opening it up. Here’s the crash log: !Name:VibgyorUnknown exception - code 00000001 (first/second chance not avai - Pastebin.com

Did you also get a callstack when the Editor crashed?

You mean this? Unhandled Exception: 0x00000001[2014.06.19-22.18.39:269][ 0]LogWindows: Bad - Pastebin.com

I looked at the callstack a second time and noticed that the second ’ was missing. Now the editor doesn’t crash anymore, but I’m getting the exact same problem as my original question described. :frowning:

Hi vibgyorc6,

This could be a silly question, but have you verified that your Blueprint is actually located in your /Game/Blueprints/ folder? I created a setup very similar to yours and it worked fine. On a hunch, I moved the Blueprint to a different folder, and I started getting the same warning message you described. When I moved it back into that folder, the warning message went away and everything worked fine again.

Also, the missing ' was entirely my fault. Sorry about that.

I guess I shouldn’t have posted this question in the C++ section because the problem isn’t just in my code. In the editor, I tried referencing the CameraBob blueprint in my player blueprint and nothing shows up in the drop down menu and just to be sure, I tried dragging the blueprint over to the drop down menu and it won’t accept it. I just get a red box.

Hi vibgyorc6,

When you set up your CameraShake Blueprint, did you create it based on a custom code class, or did you just create a new Blueprint in the Editor?

I created a new blueprint in the editor based on UCameraShake from the engine.

Try using the following lines in your code and see if it helps:

.h

class UBlueprint* CameraBob;

.cpp

static ConstructorHelpers::FObjectFinder<UBlueprint> CameraBobOb(TEXT("Blueprint'/Game/Blueprints/TestBP.TestBP'"));

Huh, it works! Thanks, ! It seems like it would be an obvious solution but I didn’t think of it.