I am using the default crouching functions, which everything I’ve read says should handle replication on its own, but for some reason it doesn’t work in my project. If the host crouches everything works fine, but if the client crouches their feet sink into the floor, the capsule doesn’t half height, and the animation doesn’t update. I’ve tried so many different combinations of RPCs and using both the 'is crouching" function from the movement component and the “IsCrouched” variable from the character and neither seems to work. I also tried to create my own variable for crouching and RPC that to force the crouch animation, but the client was still partially under the floor and I’d rather get the default function to work properly. What am i missing here?
“Replication” is a Server to Client process. Taking an Authoritative State and passing it to all relevant clients.
Communication from Client to Server is facilitated by RPCs. When a client executes an action it needs to notify the server. This is done by manually sending an RPC.
Client Input → Can I Crouch (conditional check) [True] → Crouch → RPC Server
Server RPC → Can I Crouch (conditional check) [True] → Crouch
My Bad. I forgot CMC natively sends an RPC on the client when it runs crouch/uncrouch.
The following should work out of the box.
IF you are implementing a custom crouch/uncrouch, then you’d have to handle RPCs.
Be careful with Switch Has Authority when working with listen servers. It only checks if the current actor/obj executing the code has network authority.
The Host Client always has network authority.
I’m not using a custom crouch/uncrouch, so it should work as I originally had it? What else could be causing my issues?
So I can force the crouch animation to work with a new boolean, but the character’s capsule isn’t updating, and there’s a little blip on both the server and client while the z changes (this has been happening the whole time, but I’d hoped if I found the reason the built in crouch wasn’t working it would fix it).
Host viewing the client crouching
Client viewing the host crouching
Don’t force it. Never RPC values for the server to set.
Do some debugging with print string to ensure that Crouch is being fired. Then check your animation graph state machine transition logic.
Got it! My character was inheriting from another custom character (I wasn’t originally going to have any humans in my game). The other custom character was using the smooth sync plugin, which interferes with crouch replication. I added a child BP between the two and had all my other characters inherit from the new one (with the smooth sync component) and removed smooth sync from my master character bp. Crouch replicates correctly now, although for some reason my client animates in slow motion now, so I’ve got to figure that out next.











