I’m working with a custom character class in a multiplayer game, which (since its a character) has a capsule component as root and a skeletal mesh as child. I want to Z-translate the skeletal mesh while its parent collision capsule is unaffected, but have trouble getting it to work with replicated actors.
What I see is that component functions like AddLocalOffset, SetRelativeLocation, AddRelativeLocation do not work on clients that do not have network authority of the actor. So while they work on the server, calling them on a remote client has no effect unless the client has authority over the actor. I assume this is by design, but I wonder if it is possible to enable AddLocalOffset, SetRelativeLocation even if the client does not have authority. Another problem is that even if AddLocalOffset or SetRelativeLocation is called server-side, the effect (the translation) is not replicated to remote clients. Let me emphasize that I’m trying to move the skeletal mesh itself, not the actor or the capsule component.
What I want to achieve is the skeletash mesh bobbing in water. It won’t affect our gameplay or physics since we exclusively use the capsule component to represent the character’s collision shape, so the bobbing effect does not have to be replicated. Since AddLocalOffset has no effect when called on remote clients, and when called from the server it does not replicate to remote clients, I’m not sure what I can do to achieve this. Any ideas?
Note: to see the problem yourself, create a character blueprint and try the below graph. Place a character in the world and start the game with 2 players. The remote client won’t see the character floating up.