Mesh SetRelativeLocation is not working in network

I’m not sure if this is a bug.

I use UE 4.7.4

I have a Character like upper.

CapsuleComponent Half Height and Radius is dynamic. (From CSV DataTable)

Setting Half Height and Radius is OK.

second step , I set Mesh Location to match Half Height.

It’s OK to set mesh Location in Single-player Mode ,but not working in Multiplayer Mode .
(Dedicated server)


Can you show us Blueprint you’re using to set Half Height and Radius, and Mesh Location? Thanks!

Hi ,

I’m making a MMORPG.

I have a Spawn Point.
It spawns NPCs by CSV Data.


NPC have a RepNotify Variable “NpcID”. (like Upper)

Spawn Point create NPC and set “NpcID”.

I Overridable “OnRep_NpcID” to update NPC Data. (like Upper)

I set Mesh Location to match CapsuleComponent.
But Mesh Location be reset by engine in next tick.

I doubt this is relative with “Replicate Movement”.

Is there a reason you’re using Set Relative Location only on Mesh? This would separate it from root capsule. Otherwise, I don’t really see what you’re seeing (though resulting move of Set Relative Location for a component does not seem to be replicating, which I will probably enter a bug report for).

reason I ask is because you might be better off using Add Actor World Offset node instead to move entire Character Actor, rather than only its Mesh. This also replicates properly, so it might be your best option at this point.

Thank you for your reply. Haliday.

I do not want to move Actor.
I just want to modify mesh location to correspond with capsule’s bottom.

For example.
Capsule Half Height is 200.

I need to adjust mesh location(z = -200) to fit Capsule’s bottom.
Otherwise , It will looks like floating in air.

But Mesh Location will be reset to original value which is set in editor after next tick.

Thanks for clarification! I see what you’re trying to do now, and that makes sense. I can’t reproduce exactly what you’re seeing, though: when I use Set Relative Location on a skeletal mesh inside a Character Blueprint, it doesn’t replicate this change in 4.7. I tested in 4.8, however, and results of Set Relative Location on a component replicates as expected.

You will, however, need to do change on Server and not Clients. Making this change on Client will only make that change on that Client, because replication only works from Server to Client and not in reverse. You can use and RPC call to update Server with this change, or you can make change on Server and it will automatically replicate to Clients.

Hope that helps!

Thanks , I will try it in 4.8 :slight_smile:

I’m still having this on 4.8.3, trying to do pretty much exact same thing - my crouch changes capsule size so I need to change relative location of mesh to compensate. It works fine on server, but I can’t make change show up on client regardless of where I try to do it - server, multicast, etc. Is relative location of a character’s skeletalmeshcomponent supposed to be replicated, such that I should only need to set it on server? Either way doesn’t work.

Hi ,

Can you set up a small test project that displays this behavior for me and upload it somewhere I can access? Otherwise, a complete set of reproduction steps in a new project would be helpful. Thanks!

You can replicate this problem by simply starting a new third person character and try to change relative location of a skeletal mesh post construction, i can get this to work by deactivating character movement component but moment it gets reactivated character snaps back to default relative location :confused:

Hi DwunkyPengy,

I just tried to reproduce this, and I didn’t have any trouble with Set Relative Location on Skeletal Mesh in ThirdPersonCharacter not replicating properly in 4.8.3. If you’re able to reproduce this in a new project, please upload it somewhere and post a link so I can take a look at setup that’s causing a problem for you. Thanks!

If you press G you can see shift, problem is client can see neither server nor other clients change. server however can see everyone just fine. Thanks for taking a look :slight_smile:

Ah, I see it now. Thank you for project! Looks like I was setting up my test incorrectly in 4.8 and it wasn’t actually replicating there, either.

I was able to reproduce this in a clean project in 4.8.3 as well as 4.9.0 and our internal builds, so I’ve created a bug report for issue (UE-20681). I’ll post here when I see any update. Thanks again!

Awesome, glad to see it wasn’t just me :smiley: Keep me posted, its last big bug before we can release :slight_smile:

Ok, so as a workaround i just duplicated skeletal mesh, then set original one to hidden in game and am able to replicate set relative offset with my duplicate. So that might help anyone out waiting for an official fix :smiley:

I came across same problem. We have characters that changes form including size of capsule which meant changing relative location of mesh so its flush with capsule. In a network game set relative location doesn’t work even if called on all clients. reason being is character movement component keeps a record of relative location at beginning and reuses value when doing movement smoothing. We solved issue by rerecording of relative location when we change it through code. If you don’t have access to code then there are 2 other solutions. 1. if relative location is constant then you can call set relative location every tick. or 2. Set Network Smoothing mode to Disabled which can be found in character movement component in blueprint. Hope that helps!

1 Like

I still do have this issue in 4.11. Do not know why, but mesh is trying to reach it’s original position every tick on client side. I can move it on server, and it does move. But as soon as I try to move it on client, it start to move back toward orig. loc. every tick.

Have no idea, what to do. Right now I’m going to solve this problem by hiding mesh and spawn a new one as another Actor. But this is really bad.

Does anyone fond a workaround of that?

By way. It does work Sometimes. Thats is very weird.

I have this situation here… I must change mesh’s location 5 times. First 2 times it does not work. But after it does work. Always…

Why is this happening?

Still present in 4.13 ya’ll.

I found reason, why this is happening…

That is because Character’s Movmenet component and its network prediction and smoothness logic.

To get rid of that, try to disable “Network Smoothing Mode” inside character mov. component. That shold stop tick interpolation of mesh toward it’s original position.

Helped me in 4.11