Why are Client character animations not running on the server?

Hi, I have a basic multiplayer system set up.

Characters have a skeletal mesh with animations.

The issue I have is that while all animations work fine on the clients (including other clients’ characters), the server can only see the animation of its own character.

The animation blueprints for client characters do not seem to run at all.

What could cause this?

Have you looked into your character’s mesh MeshComponentUpdateFlag? By default it is set to EMeshComponentUpdateFlag::AlwaysTickPose which means tick, but don’t update bones. You would want to set it to AlwaysTickPoseAndRefreshBones.

Thanks,

-Laurent

I sent out email about this topic. Sorry for delay.

Turns out I had the mesh as an extra Skeletal Mesh component in my character. I removed it, and set it up in the native mesh of the character.

The previous Skeletal Mesh also wasn’t set to Character.

I still don’t know exactly why either of these things would cause it to not animate on the server, but it works now.

This turned out to be the issue for me as well. Started with first person template, added my own skeletal mesh (with animation blueprint) to the character. Result is it wouldn’t play on server. Following this answer, I removed the original mesh that came with the template (also removing the reference to it in the input blueprint) and the new skeletal animation played just fine on server and client!

So what exactly does this do? Does it send the transforms for all my joints to all of my connected clients?

what do you mean you removed the extra skeletal mesh and set it up in the native mesh of the character? also, what do you mean by the previous skeletal mesh wasn’t set to character?

I had an extra skeletal mesh component in the Character (In addition to the default native mesh). I removed this, and used the native mesh instead. The type of the native mesh is set to Character. I’m not sure what that does, but I think it was only on the native mesh.

To be honest I thought you were all crazy… Turns out that having multiple skeletal meshes in the same character BP is a problem! Thanks for all the help!

To add onto what was said here

If you are using the First Person Shooter template to start your game just go into the C++ or BP and move all the stuff that is being done on Mesh1P up to Mesh and delete Mesh1P. If you are using the C++ project like I am you will also need to remove

Mesh1P = PCIP.CreateDefaultSubobject(this, TEXT("CharacterMesh1P"));

and then what I did is just delete the 1P from all the lines below and it started working.

This does raise a question from a programmers perspective on this. Does anyone know why this happens? What if I did need more than one skel mesh on my character?

I’m having the same problem as you, except i can’t seem to associate the inherited mesh with a camera (as in i can’t drag the inherited mesh onto the camera component so that the mesh will be a child of that camera) because the mesh is inherited and can’t be moved or deleted.

Is there any better solution for this? I am using a first person and third person mesh, both set up in code, and am getting the same problem. I actually need to have both as I want the first person player to see their refection (the FPS mesh is only owner see and the third only non-owner see)

Thank you Laurent - this solved my problem. I was doing a hitscan test from the muzzle socket of weapon attached to the animating player. Worked in co-op on a listen server but on a dedicated server - the muzzle socket transform was completely different on the server (since it was not rendered, therefore not updated). Here is the code comment:

AlwaysTickPoseAndRefreshBones

// This is the update frequency flag even when our Owner has not been rendered recently

SMU_AlwaysTickPoseAndRefreshBones,	// Always tick and Refresh BoneTransforms whether rendered or not
SMU_AlwaysTickPose, 					// Always Tick, but Refresh BoneTransforms only when rendered
SMU_OnlyTickPoseWhenRendered,		// Tick only when rendered, and it will only RefreshBoneTransforms when rendered