Download

How do I replicate animation blueprint in Cpp?

I have this so far and it works:


UPROPERTY(BlueprintReadWrite)
	UEnemy_AnimInstance* animInstance;

But when I change it to this:


UPROPERTY(BlueprintReadWrite, Replicated)
	UEnemy_AnimInstance* animInstance;

Or this:


UPROPERTY(Replicated)
	UEnemy_AnimInstance* animInstance;

Or this:


UPROPERTY(Replicated, BlueprintReadWrite)
	UEnemy_AnimInstance* animInstance;

It gives me that error:

Hi,

Only AActor can replicate, UAnimInstance is UObject.
Please someone correct me if I’m wrong. :wink:

So how am I supposed to get the animations to be replicated.

Correct me if I am totally of with this, but don’t replicate the anim instance, replicate for example a variable with On_Rep and let that set/trigger the anim instance on the clients.
As said, I’m really tired so I might just have misread the whole thing :slight_smile:

Yep I guess you are right, Thanks!