After setting AnimBlueprintClass with Blueprint the animation blueprint states to not operate

If i set the animation class via blueprint the animation for the player never starts the player is stuck in the TPose default and when debugging the graph the isValid for the character fails.The character skeleton and animation works lovely if i use the drop down in the default section of the character blueprint. But when setting this on event play it does not initialize it seems.

When moving in the world i can move and jump but no animation states execute.

Is there any kind of solution for dynamically set character mesh and animation BP? I’ve been trying to find someway to get this working but the only way the animation plays is if i manually set the animation BP from the Default tab.

Figured it out in C++. I had to add the dynamic changing code in the Character class itself.

template <typename ObjClass>
static FORCEINLINE ObjClass* LoadObjFromPathPTR(const FName& Path)
{
	if (Path == NAME_None) return NULL;
	return Cast<ObjClass>(StaticLoadObject(ObjClass::StaticClass(), NULL, *Path.ToString()));
}



// Load Static Mesh From Path 
static FORCEINLINE USkeletalMesh* LoadSkelMeshFromPath(const FName& Path)
{
	if (Path == NAME_None) return NULL;
	return LoadObjFromPathPTR<USkeletalMesh>(Path);
}

// Load Static Mesh From Path 
static FORCEINLINE UAnimBlueprint* LoadAnimBPFromPath(const FName& Path)
{
	if (Path == NAME_None) return NULL;
	return LoadObjFromPathPTR<UAnimBlueprint>(Path);
}

void AAI_PartyMemeber::SetupDynamicSkelAndAnima(FString Skel,FString Anim)
{


	USkeletalMesh* skelObject = LoadSkelMeshFromPath(*Skel);//load the object as per tutorial below or use static load object directly, or use ObjectFinder.

	if (skelObject && Mesh)
	{
		Mesh->SetSkeletalMesh(skelObject);
	}

	
	UAnimBlueprint* AnimObject = LoadAnimBPFromPath(*Anim);//load the object as per tutorial below or use static load object directly, or use ObjectFinder.
	
	if (AnimObject && Mesh)
	{
		Mesh->SetAnimClass(AnimObject->GetAnimBlueprintGeneratedClass());
	}
}