I have a character that is owned by a player controller that was generated the moment the player connected.
My problem is when I send through a RPC of type server from the PlayerController of the client, an AddMovementInput() which correctly receives the value of the Vector passed by the player in the RPC function, which is executed correctly, but the character does not move.
If I change my RPC to Client it is called AddMovementInput () again it runs exactly the same, but in this case the character is moving but with lag, so i want to enable the server to move the character but im not able, only the client can do.
i have try activing bRunPhysicsWithNoController in the character controller but AddMovementInput still not working.
The Character system has a dedicated (and complex) built in system for networking.
What you need to do is ensure that the controller “posesses” the Character, and you can then call AddMovementInput() locally (without any RPC’s). Generally it’s better to do this in the Character rather than from the Controller.
Yes im doing in that way, moving locally from character and it works it move the Character but if the player connected have more than 80ms of ping, character moves like this: - YouTube
So i was trying to move the character from the server to avoid this.
Do i have any alternative to move the player from the server or to avoid the player moves with lags when im adding the input locally?
There is something you do wrong, as if the character movement componenent is correctly setup, the experience should be totally smouth, even with a ping as 80ms.
You move with keyboard ?
Do you change the value of network smooth in the character movement componenent ?
I don’t think this is the issue but, assure your display mesh have no collision (only the capsule component should have).
The best is to show us you’r code, so we can help you with more accuracy.
First thing : movement component handle the network, you should not replicate by yourself, but let the movement component.
Try to just add move input locally, and that should worlking fine, in network.
The only reason the character moves that way is because it isn’t setup correctly - You should not be sending any RPC’s at all.
The Character system does not need any extra networking functionality, it does everything for you. All you need to do make sure the client has possessed the character, and the client alone calls AddMovementInput. If you don’t possess the character, it will not work properly.