Setting Animation Blueprint Class Via Event Play Begin never initializes.

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.

Here is my BP.

Has anyone tried this or know where i can find for more data on this? I’ve looked through some docs and I dont see anything on changing this via script. Maybe its not to be done?

My hope is to have a master Monster AI that dynamically loads the data for itself and can instance the same AI state machine and can be modified via Editable BP Configurations to change its behavior patterns. This is to avoid having to make Character BPs for every monster type when the basic operations are the same minus the actor and the animation class. Depending on monster base type.

Figured out how to do this via C++.

Posted my solution in answers:

Hi Shoiko,

You want to use in the SkeletalMeshComponent:

UFUNCTION(BlueprintCallable, Category="Components|SkeletalMesh")
void SetAnimClass(class UClass* NewClass);

This will change your AnimBlueprint at runtime.
We’ve made a note to rename this to ‘SetAnimBlueprint’ so it is more discoverable.

Awe the more you know… Well atleast i know two ways to achieve this. I’’ copy this to the answers sections as well.