Download

Odd Issue - Host to Clients Replication

I have a custom event that my host uses to crouch, shrink their capsule collider, and show everyone they are crouching. See attached.

It works, but at the last second, the client sees the host sunk into the ground, and the host is just fine. I’ve verified that the correct data is being replicated to clients via a print string test, so it’s something odd at the very end. See second photo.

This custom event is set as a Multicast and is only run by the server player. Trying to see what I’m missing that is making this last second reset of position happen. I can actually watch the transition happen properly, and when the timeline completes, it seems to revert back to the original relative location.

So I made a very crude workaround that I would need to refine, but I do not feel like this is the proper setup for my character replication. I think I’m hitting a bug and my forum searches of my specific issue is looking like I’m not mistaken.

I will have to add a new boolean for each action, so instead of just “crouching” to change animations, I will need to do “crouching” to change the animations and then “crouched” to hold the player into position to do the crouching animation properly for all clients. Is there a reason why the character is snapping the mesh to the default relative location on clients? Am I somehow overwriting a command to set it somehow for my clients?

I am totally not convinced this is the best way to handle this. This is only my Host character as well.

My conclusion is that this must be a bug, and I have implemented the aforementioned bugfix in my last reply. I have also copied that logic and have gotten it ready to start working on my prone logic as well.

BUG: Setting Relative Location of Child Mesh on Replicated Character blueprint will snap back to default position for clients.

Steps to replicate:

  1. Use a default third person character starter project, and open the blueprint for the third person character.
  2. Create a custom event, set it as Multicast.
  3. Use “SetRelativeLocation” on the mesh object of the Character with this custom event, and change it to any noticeable value (-180 for example)
  4. Run 3 separate editor window instances as listen server with 3 players
  5. In the Server Instance, notice the clients see the host at their default location, server is in a new position.

Temporary Bugfix:

  1. Create a custom event and have it set the relative location to your desired location separate from any other method.

  2. On EventTick, have a bool check to see if you need to use the bugfix (Example: is it supposed to be crouched, but is bugged out?).

  3. If bool is true, use the custom event you created in step 1 to set it every tick (Note, this needs to be called on the server, see clarification below)

  4. If bool is false, then it does nothing to correct location of Mesh.

**Clarification: If the host is running this command in a multicast, it will replicate the correction to all clients. If you want a client to correct itself, you will essentially call a custom event to “Run on server” and then from that event call the same “Multicast” that was used for the bugfix on the host player.

I will be using this forum post a link to bug report. Thanks for anyone who mulled it over and gave any input.