I currenly have a strange problem with my MovementComponent and the rotation of a Mesh.
My Character is just the basic Character, nothing changed yet, except adding a spring arm and a camera. I implemented Movement (that works well) and try to only rotate the Mesh of the Character… not the capsule… not the Spring arm attached to it… just the mesh…
The reason is, that I want the camera to be fixed in a specific Direction from TopDown. Imagine a Diablo like Camera Angle and movement relative to the world rotation (0,0,0).
The Movement is working like a charm.
But the Rotation of the Mesh, not… It´s working on Client side, but the other Player just sees the moving Character staring initial direction… so… the rotation is not replicated…
Since I wanted to try some solutions… I added the MeshRotation Variable, RepNotified…
This is the OnRep Function:
Hello. Have you managed to find solution for this issue?
I also have problem with rotating “Character” original “Mesh”.
P.S. If I add custom “SkeletalMesh” and do my rotation operations with it, it works like a charm on both client/server, but original “SkeletalMesh” which is imported with “Character” have those werid issues.
UPDATE:
Okay, so after spending two full days, I found solution 20 minutes later after writing this post.
So the issue is that “CharacterMovementComponent” rotates original Mesh of “Character” on his own.
I won’t go into details since I’m not proficent enough in C++ and networking, so I can just show you solution which worked for me.
When you dealing with not localy controlled Character, you need to work with “BaseRotationOffset” property of “Character” class, instead of directly rotating Character’s “Mesh” (through functions like “SetRelativeRotation”).
I needed to execute rotation code inside of my “Animation Blueprint”, so I’ve created public blueprintable function: