As the title said, myReplicationUsing binded function is not being called. I think I already got all the things that it need to be done in advance, and testing with 2~3 players in Play with listen server mode, yet the binded function is never being called, if anyone know this kind of problem just give me a hand, that will be a great help! Thanks!
here is some associated code:
void ABlasterCharacter::OnRep_OverlappingWeapon(AWeapon* LastWeapon)
{
if (OverlappingWeapon) {
if (GEngine) {
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Green, FString::Printf(TEXT(“FitrstWeaponCalled”)));
}
OverlappingWeapon->ShowPickupWidget(true);
}
if (LastWeapon) {
if (GEngine) {
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, FString::Printf(TEXT(“LastWeaponCalled”)));
}
LastWeapon->ShowPickupWidget(false);
}
}
this is the binding function that not working, in charge of setting the visibility of a widget.
Header:
public:
virtual void GetLifetimeReplicatedProps(TArray& OutLifetimePorps) const override;
UPROPERTY(ReplicatedUsing = OnRep_OverlappingWeapon)
class AWeapon* OverlappingWeapon;
UFUNCTION()
void OnRep_OverlappingWeapon(AWeapon* LastWeapon);
cpp:
void ABlasterCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const {
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME_CONDITION(ABlasterCharacter, OverlappingWeapon, COND_OwnerOnly);
}