How to replicate pawn?

I just started looking at setting up a dedicated server and client. Those work but i’m not quite understanding the replication stuff. I have a pawn mesh

UPROPERTY(EditAnywhere, Replicated)
		UStaticMeshComponent* birdMesh;

In the constructor of the class i have
bReplicateMovement = true;
bReplicates = true;

I also added a function

void ABird::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);
	DOREPLIFETIME(AFlappyBird, birdMesh)
}

This class inherits from APawn and has a FloatingPawnMovementComponent.

Should this now show the mesh and updates it’s location on all clients? Or is this not enough?

Hi there. You have given us some info but not the pertinent stuff. No worries, replication is a tough concept to grok. Answer to follow.

Likely this is not enough, in fact you probably dont need to replicate the mesh. In order to better answer your question we need more information. What is the parent class of your bird? Does it have a movement component?

If you want to replicate the position of an object you really want to be using a movement component. If you look at the character class, it has a movement component responsible for replicating the actors movement.

If you want to replicate movement, try this. Create a child class from character. It already has a movememt component, skeletal mesh, and derives from pawn which gives you the ability to use either a player controller or an AI controller for possession.

I dont know how you are trying to move the actor, but if you are authority or autonomous proxy the movement should be replicated.

I added some info :slight_smile: thanks for the info though !