How to replicate Character Movement Component

I have a character. All movements replicates to server.
But when i try change “Set Movement mode” from Walking to Flying, it’s not replicates. Character stays on Walking mode.

This screen from BP_PlayerCharacter

Checkbox in character movement component is on.

So, the situation is following.
Player1 on Host-Server can switch Movement modes,
Player2 on Client can’t switch Movement modes.

How to fix it?

Hi
Everything works fine for the host, but not for the client, because in Unreal Engine the host is both the server and a client at the same time. So when the host changes the movement mode, it’s directly done on the server, and it works.

But a client is a separate machine that doesn’t have the authority to directly modify server-side logic. So when the client tries to change the movement mode, the server doesn’t know about it — and nothing happens.

To fix this, you need to make sure that the client sends a request to the server, and the server handles the actual change of movement mode.

Here’s what to do:

  1. Create a Custom Event in your BP_PlayerCharacter that is set to Run on Server.
  • In the event settings, enable Replicates → Run on Server.
  • For example, name it SetFlyMode_Server.
  1. Inside SetFlyMode_Server, implement the logic that sets the movement mode (e.g., Set Movement Mode to Flying).
  2. If you already have an event like SetFlyMode that is being called on the client (e.g., on key press), you should modify it to call SetFlyMode_Server instead.

:warning: Important: The server should not call the client to change movement. Instead, the client must ask the server to make the change. That’s likely where the problem in your current setup is.


Additionally, I noticed you’re using the Get Player Pawn node with Player Index = 0. This can cause issues in multiplayer. Each client has a different index, and index 0 usually refers to the server/host. So when multiple players are connected, this reference may not work as expected.

Recommended approach:

  • Use PlayerState to get the Controlled Pawn.
  • Then cast it to your character class.
  • From there, access Character Movement and perform your logic.

This method avoids index-related issues and makes your system more stable in a multiplayer environment.

@9Evgeny9 You need to read the Character Movement Component (CMC) Docs.

It doesn’t matter if you understand it completely now, just that you read it top to bottom. Understanding will come over time. Experience is earned through practice.


The short of it is CMC uses Client-Side Prediction.

CSP requires the client (Autonomous Proxy) to apply changes directly to the client, THEN have the server TRY to make the same changes. If the server says no, then it tells the client to correct.

Client is the “Local Authority”, but the Server is the “Global Authority”.

This is how over 90% of CMC works. Movement Input, Camera Input, Speed changes, Jump, Crouch etc. All added functionality should follow the same flow rules.

Client: Can I do this Action? If True, Apply the change. Tell the server to try.
Server: Can I do this Action? If True, Apply the change.

CMC’s server correction only applies to MOVEMENT. Note that not all of CMC variables are replicated. You will have to create your own methods to apply server correction to custom logic outside of the generic movement the component provides.


You do not EVER modify a class from another class. All code to make changes to a class must be coded in the owning class and be Applied by that class.

e.g. Have Player State, Player Controller set CMC movement mode.


How to Properly apply Movement Mode Change.


edit… FYI, Character Movement Component does not replicate. It doesn’t need to. All replication is handled in C++ RPC’s for the most part.

image