How do I set up Root Motion on a Dedicated Server?

I found the answer myself and thought that I should share it in case anyone else has this problem.
All you need to add is the following line of code:

Mesh->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::AlwaysTickPoseAndRefreshBones;