Help With Replication Problem?

I have a system in my character blueprint that takes both input axis and compares them so see if the player is trying to move.

When this bool(“Moving”) is set the player switches blendspaces. One being one where the player is going from Idle to Skating, and another with just the Idle, I did this to achieve the look of momentum carrying the player a little after they stop moving.

My problem is replicating this for the server. The host can see both itself and the client skate. But the client can only see the host skate and not them self(they seem to be stuck in the idle only blendspace)

What am I doing wrong?

Here is the blueprint.

When the bool is set to true by default, the replication works fine, It seems that the bool is being set twice or it may be that the server is overriding the bool and setting it to false which doesn’t allow the client to be set to true.

Is this a problem because of the actors being the same? how could I prevent this bool problem if this is in fact the issue?

When you set a replicated variable on the server it eventually gets set on the client. If you set it on the client then the client can be out of sync until the server “sync” the variable with a new value.

You probably don’t want to set the variable with an RPC on the client (ServerMoving?) but instead you should make the variable RepNotify and use the OnRep function.

I looked at some tutorials but I’m kind of confused on how to use the OnRep function properly I ended up with an infinite loop error because I’m unsure of how to set the bool in the function correctly.

here is what I have



Thank you for the help so far.

I checked the logs and I found this, I’m using the steam online subsystem so I’m not sure if that’s causing any problems.

LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor Beat_BP_C_1. Function CheckMoving will not be processed.

This was before I changed it to the configuration above.

I am still confused as to why you are setting the variable again after it has been replicated. Just Set the variable on the server and perhaps call a function in OnRepMoving. If you set the variable again OnRepMoving is is indeed an infinite loop since the Setw/Notify node is the one that calls the OnRepMoving Function.

What function would I be calling in OnRepMoving? would I call the replication events there?

Ok the first configuration I had seems to be the correct one with a couple problems, I have a print string checking authority and the bools for the server and client, the server is replicating fine for the client.

On the clients side however its bool is being switched from true to false as soon as it ticks true, it seems to be replicating fine but something is setting it to false on every tick, which is why I thought it wasn’t replicating.

I have this blueprint running on an event tick and I’m assuming because the server isn’t moving its making it so the client isn’t on the client side?

It seems my problem was running this on an event tick/timeline and not the replication itself. Instead I ended up plugging in this from the input moveforward/moveright and it worked perfectly

I don’t know why this worked considering these both run on a tick if I’m correct?