AnimInstance Replication

I am replicating my character across servers, and all of the required properties of my character. These are of various types - UActorComponent and USphereComponent for example. They all replicate perfectly, just as expected.

The animation component is a custom class, derived from UAnimInstance. This is the only property on the character that is NULL when checked for on the clients.

My setup in the header is as follows:

// Player animations
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated, Category = Character)
UCharacterAnimator* Animator;

And in the implementation class, it is included in the list of replicated properties:

void ARoguelikeCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);

	DOREPLIFETIME(ARoguelikeCharacter, Details);
	DOREPLIFETIME(ARoguelikeCharacter, Health);
	DOREPLIFETIME(ARoguelikeCharacter, States);
	DOREPLIFETIME(ARoguelikeCharacter, ClassData);
	DOREPLIFETIME(ARoguelikeCharacter, Statistics);
	DOREPLIFETIME(ARoguelikeCharacter, Skills);
	DOREPLIFETIME(ARoguelikeCharacter, Equipment);
	DOREPLIFETIME(ARoguelikeCharacter, Animator);
	DOREPLIFETIME(ARoguelikeCharacter, VisionSphere);
	DOREPLIFETIME(ARoguelikeCharacter, RecentlyStruck);
	DOREPLIFETIME(ARoguelikeCharacter, IsRolling);
	DOREPLIFETIME(ARoguelikeCharacter, Stunned);
	DOREPLIFETIME(ARoguelikeCharacter, IsInCombat);
}

Everything is replicated, save for this object.

For further clarity, in the constructor of my animation object I am setting bReplicates to true, and all of the properties have the Replicates tag.

Is there any way to replicate a UAnimInstance object? I use it to play animations based on state changes in the character class.

If this is not possible, what alternatives might I have?

A pattern I have had success with in the past is to have the AnimaitionBlueprint read variables off it’s owner in UpdateAnimation.

In that way, you only need to replicate the owing pawn state.

Interesting approach, but I’m not sure it’d work for me :frowning:

I use the C++ object to call functions that dictate the animation logic from my character class and elsewhere. At the moment it’s crashing as I’m unable to call those functions, as the object is null.

Is it the case that AnimInstance simply can’t be replicated? If so, that’s a huge pain for me.