Hi,
I have bumped Into this weird Issue the problem Only happens Under a certain condition.
to replicate the problem here are the rules:
PreCondition : Set Network Emulation To Bad Or Avg
1.Start A Listen Server
2.Once The Client Screen Is Still Black (Is In Process of Joining) Use The Host(Listen Server Client) To Call Multicast Events Repeatly (In My case Its a Automatic Weapon).
3.This Will Cause The Client (Which Just Joined) To Not be able to see any effects that are multicasted.
Code::
// Local Simulation Of Effects
SpawnMuzzleFlash();
SpawnBulletTrail(HitDetails);
// To Spawn Effects On Server And other Clients
if (GetLocalRole() == ROLE_Authority)
{
MulticastSpawnEffect(HitDetails);
}
else
{
ServerSpawnEffects(HitDetails);
}
And Here is the _Implementation
void ARHN_HitScanWeapon::ServerSpawnEffects_Implementation(FHitDetails TraceHitInfo)
{
MulticastSpawnEffect(TraceHitInfo);
}
void ARHN_HitScanWeapon::MulticastSpawnEffect_Implementation(FHitDetails TraceHitInfo)
{
// Check If Weapon Owner Is Valid
if (OwningCharacter)
{
// Since We already Simulated The Effects Of The Locally Controlled Client/Host we don't need to spawn those effects again So Skip the Locally Controlled
if (!OwningCharacter->IsLocallyControlled())
{
// Spawn Effects
SpawnMuzzleFlash();
SpawnBulletTrail(TraceHitInfo);
}
}
}