Blueprint to pick up and move objects - movement not replicating

Forward: I have completed YouTube tutorials 1-83

I created an actor blueprint, PlaceWall, which contains a wall static mesh and for some reason an audio component I’m just noticing now, no idea why it’s there.

Here is the defaults panel. I have replication enabled.

Here is the wall’s event graph.

The wall is implementing an interface, “UseInterface”

Both functions, OnUse and OnUse - Holding have a character input pin.

When the character presses “E”, it runs a “InputAction” event. Here is the event graph for my character using the InputAction event

The basic functionality is, if the player is holding an object, activate that object’s OnUse - Holding event. If they are not holding an object, run a trace from the camera to see what they’re looking at. If they’re looking at an actor within 200 units, attempt to run the actor’s “OnUse” event.

So, the first time through, the player walks up to the wall, presses “E”, the event graph activate’s the walls “OnUse” event which triggers the character’s “SetHoldingObject” event, which is this:

This checks to make sure the character is not holding an object. If they are not, assign the object to the character’s “HoldingObject” so I can reference it later, set “Is Holding Object” boolean flag, attach the object to the player’s camera, and disable collision.

Now, if the character presses “E” again, the “InputAction” event fires, sees an object is being held, and runs the wall’s “On Use - Holding” event which calls the “Place Held Object” event on the character.

This detatches the object from the camera, re-enables collision, and clears the held object and boolean variables.

In single player, this works exactly how I want it. You press “E” on the wall and it is attached to your camera, you can see it in front of you. It stays attached until you press “E” again and then it is fixed in place where it was when you pressed it.

If I simulate multiplayer, different things happen for both the client and server.

Server: Server picks up the wall and runs around. The client can see the wall moving, and it is almost perfect except that the wall should also move when the camera moves (camera rotates yaw/pitch with mouse up/down, character moves x/y with WASD). So if the server looks around without moving the character, the client does not see the wall move.

Client: Client picks up the wall, server does not see the wall ever move. Client can’t move through the place where the server still sees the wall.

Edit: I’ve fixed the issue where the server’s camera rotation was not synced by creating a variable for it that gets replicated. However, still, anything the client does never makes it to the server.

I would really appreciate some input on this.

Thank you

can you finish tutorials all the way till 86?
the default tab “replicate” check box for actors are deceiving, so make sure you fully aware and understand who has authority, what/when should your variable be set, and how to do it properly.

I guess this worth some decent write up, judging by how many replication related post hopes it magically works when you check variable’s replicated box.
Plus some other guy mentioned about the lag simulation, so I might actually setup a test project tomorrow to make sure I also figure that part out during the weekend.

ps. it’s “foreword”

I’m actually on 85 right now, going through the same steps being shown on the video and I’m getting different results. In the video, he sets up a “health” variable on the character with rep notify and has it run only with authority. The rep notify sets a text render component to be the current health… very simple. When he tests it, it shows both the client and server, each updated correctly. On mine, only the server has the correct health, the client still has the default “Text”. Incredibly frustrating, not sure if there is a difference in the version of engine or I’m missing something obvious.

yes the engine he show this tutorial is about 4.1 or a bit before 4.2(blueprint network example in earlier isn’t in Content Example pack until 4.4 I think)
I’m currently cleaning up my initial multiplayer test in Tom’s thread, and maybe add a few more things to test.

You need to make sure all the events you call are set properly with replication part, in the video he might have missed something due to editing.(but I think it should be rare)
if anything open blueprint and use the debug feature, I use this all the time to check my event flow even in multiplayer environment.
Note, each time you hit play, the player controller and pawn will have different number, it’s a bit frustrating, but the order of number should be the same.
ie in first play you have 2 pawn, on server is C1 C2, on client is C3 C4, so on next play, it will be 5, 6 on server and 7 8 on client. what ever represents C1 will then be come the smallest number on Cx when you play.
So just follow this rule when you debug.(put a dummy event that does a print probably is more helpful)