I am trying to use ChaosVehicles plugin in a multiplayer game I’m building. From what I’ve read in the documentation, I should set movement replication on my pawn to false, and set the child vehicle movement component to be replicated.
For some reason with this setup, the player can drive around, but other clients don’t see the vehicle moving at all. I think I’ve tried just about every combination of settings I can think of, but nothing seems to work.
My VehiclePawnBase.cpp file has
AVehiclePawnBase::AVehiclePawnBase()
{
bAlwaysRelevant = true; // Temporarily for testing - ensures all clients see it
SetNetCullDistanceSquared(0.f); // No network culling
// Network replication with physics resimulation mode
// Server is authoritative, clients predict locally and resimulate on corrections
bReplicates = true;
SetReplicatingMovement(false);
SetPhysicsReplicationMode(EPhysicsReplicationMode::Resimulation);
}
void AVehiclePawnBase::BeginPlay()
{
Super::BeginPlay();
PrimaryActorTick.bCanEverTick = true;
// Enable vehicle movement component replication for physics resimulation
if (UChaosWheeledVehicleMovementComponent* VehicleMovement = Cast<UChaosWheeledVehicleMovementComponent>(GetVehicleMovementComponent()))
{
VehicleMovement->SetIsReplicated(true);
}
}
My full pawn class is here: VehicleInteractionComponent.cpp · GitHub
And here’s a video of what happens: Watch vehicle movement replication broken.mp4 | Streamable
Any help would be greatly appreciated!