I’m started off with a default third person C++ template and started making a custom character that has the same Blueprint Animation as the template. I used the following code in the constructor:
static ConstructorHelpers::FObjectFinder<UAnimBlueprintGeneratedClass> Anim(TEXT("AnimBlueprint'/Game/Character/HeroTPP_AnimBlueprint.HeroTPP_AnimBlueprint'")); GetMesh()->SetAnimationMode(EAnimationMode::AnimationBlueprint); GetMesh()->AnimBlueprintGeneratedClass = Anim.Object;
I’m using 4.6.1 and as far as I’m aware, this should be okay, but I get the following message when I run the code:
Any ideas as to what I could be doing incorrectly? Also, in case anybody is wondering, I got the folder-path to the Animation Blueprint by right clicking on the asset in the editor, clicking copy reference, and then pasted it into the code.