Hello. I have encountered one of the weirdest bugs. I am making a multiplayer shooter and I was working on bullet replication. Currently this is how I have everything setup:
void ABaseProjectile::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(ABaseProjectile, bIsInitialized);
DOREPLIFETIME(ABaseProjectile, bCanBeDestroyed);
DOREPLIFETIME(ABaseProjectile, CollisionBox);
DOREPLIFETIME(ABaseProjectile, NiagaraParticleSystem);
DOREPLIFETIME(ABaseProjectile, ProjectileMovement);
}
This is replication setup in C++.
As you can see replication is also set on the Blueprint as well (including movement). It’s set on every component.
And this is how the firing logic is set up. Basically a timer is set off to do rapid firing which just calls an event on the server which in turn calls a multicast which spawns the bullet actors. On the server it works fine. But on the client here is what happens:
As you can see there are copies of the bullet that get stuck in the air. There is a visual effect that it flies out into the distance but a copy is made for some reason that is just stuck a few centimeters from it’s span location. What could be the problem?