@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.
