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.

The 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)

Hi KONADEV,

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

Hi Ben Halliday,

I’m making a MMORPG.

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

41350-b2.png

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 the Mesh? This would separate it from the root capsule. Otherwise, I don’t really see what you’re seeing (though the resulting move of Set Relative Location for a component does not seem to be replicating, which I will probably enter a bug report for).

The reason I ask is because you might be better off using the Add Actor World Offset node instead to move the 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. Ben Haliday.

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

For example.
The Capsule Half Height is 200.

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

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

Thanks for the 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 the results of Set Relative Location on a component replicates as expected.

You will, however, need to do the change on the Server and not the Clients. Making this change on the 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 the Server with this change, or you can make the change on the Server and it will automatically replicate to the 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 the exact same thing - my crouch changes the capsule size so I need to change the relative location of the mesh to compensate. It works fine on the server, but I can’t make the change show up on the client regardless of where I try to do it - server, multicast, etc. Is the relative location of a character’s skeletalmeshcomponent supposed to be replicated, such that I should only need to set it on the server? Either way doesn’t work.

Hi Joe,

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 the relative location of a skeletal mesh post construction, i can get this to work by deactivating the character movement component but the moment it gets reactivated the character snaps back to the default relative location :confused:

Hi DwunkyPengy,

I just tried to reproduce this, and I didn’t have any trouble with Set Relative Location on the Skeletal Mesh in the 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 the setup that’s causing a problem for you. Thanks!

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

Ah, I see it now. Thank you for the 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 the 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 the last big bug before we can release :slight_smile:

Ok, so as a workaround i just duplicated the skeletal mesh, then set the 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 the same problem. We have characters that changes form including the size of the capsule which meant changing the relative location of the mesh so its flush with the capsule. In a network game the set relative location doesn’t work even if called on all clients. The reason being is the character movement component keeps a record of the relative location at the beginning and reuses the value when doing movement smoothing. We solved the issue by rerecording of the relative location when we change it through code. If you don’t have access to code then there are 2 other solutions. 1. if the relative location is constant then you can call set relative location every tick. or 2. Set the Network Smoothing mode to Disabled which can be found in the character movement component in the 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 the mesh and spawn a new one as another Actor. But this is really bad.

Does anyone fond a workaround of that?

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

I have this situation here… I must change the 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 the 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 the mesh toward it’s original position.

Helped me in 4.11

1 Like