Has Authority is Not being called Consistently when simulating lag

I am using anim notify to Call a function to finish Reloading at the end of Anim Montage using the following code

	if (MyCharacter == nullptr) return;
	bLocallyReloading = false;

	if (MyCharacter->HasAuthority())
	{
		UpdateAmmoValues();
		CombatState = ECombatState::ECS_Unoccupied;
		if (GEngine)
			GEngine->AddOnScreenDebugMessage(-1, 1, FColor::White, FString::Printf(TEXT("Unoccupied")));
	}

These function are on Component class made to handle Reloading and Firing with Enum to change State, the combat state is Replicated using RepNotify. The problem I am facing is that CombatState = ECombatState::ECS_Unoccupied Is Called inconsistently on Reload, the problem occurs 3 out of 5 times and locks you in the occupied state its inconsistent, some time it can happen on the first reload or some times on the 3 or 4th but it happens surely. Basically MyCharacter->HasAuthority() fails causing the problem is my guess Please Correct me if am wrong and Unoccupied is not being replicated on Client Consistently I think, is there a way make this consistent this only happens on client under network lag simulated.

Removed this from OnRep notify to RPC unreliable fixed the issue

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.