Character movement not replicating

Hello,

I’m trying to setup a coop 2D game and i’m having issues getting the character movement to replicate to clients. My actors appear to be setup correctly, and I’m not sure where the issue lies.

I have my Character class that was pregenerated by the 2D Platformer template in C++. I’ve made changes to insert animations and basic logic etc for moving. Didn’t touch anything code wise on the networking side. I created blueprints based off each class so my designer can add functionality if needed and whatever. The actors in the Blueprints are set to replicate, and movement is set to replicate.

The server replicates the animations, and shows the correct animations and rotation for the actor on the client. But no movement shows from the servers actor on the client. So you see the actor turn, and the animations for crouching happen. But it all happens in the initial position. Nothing from the client replicates to the server either.

None of the movement ever makes it to the client, so doubt its lag. Especially since the animation changes are instant.

Also, for whatever reason, the clients pawn floats in midair at the spawn and has no physics. This is on the client as well as the server. It also does not allow me any movement. My level has 2 player starts and the server correctly spawns the players at both randomly.

I have a C++ GameState, GameMode, and PC class but all have no code other than what the editor generates. I plan to add more code later, but mentioning here anyways. All have Blueprints generated from them that will be actually used. All C++ classes in this project are base classes and blueprints will be based off them for actual use now that i think about it.

I feel like Im missing something in my code to tell the server to replicate things, but at the same time since half is replicating and not, Im not sure. Not to mention I generated the same C++ 2d template and ran it and the networking was fine. All ive changed is logic for animations (Based off variables that are replicated) and added in a half-height change on the capsule component when the character ducks. Ive looked through all of Epics documentation on networking, but it just seems like the replicate movement checkbox and replicates checkbox should do the logic for the particular bug im having.

Ah, I fixed my own issue. I forgot to call the Super function in my void ASideOpCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
}

adding

Super::GetLifetimeReplicatedProps(OutLifetimeProps);

to the function body solved the issue.

Man you saved my life :smiley: