Hi all,
I’m looking into working with a DOREPLIFETIME_CONDITION
DOREPLIFETIME_CONDITION(APickup, bShowPickupName, COND_OwnerOnly);
I seem to have something wrong with ownership, since the OnRep of bShowPickupName is not running.
I’m using a listen server for the project.
I have APickup actor whichis a BP_Pickups derived from Pickup C++ class.
The pickup is dropped in the level through the editor and not spawned from within a class.
When the player’s collision sphere overlaps with the pickup’s collision box I run this:
if(HasAuthority()){
bool ImplementsInterface = UKismetSystemLibrary::DoesImplementInterface(OtherActor, UInteractableActorInterface::StaticClass());
if (ImplementsInterface){
APickup* pickup = Cast<APickup>(OtherActor);
if(pickup){
pickup->SetShowPickupName(true);
}
}
}
The SetShowPickupName is the setter for the replicated bShowPickupName bool.
After this is changed, the replication’s OnRep should be called for the owner.
Since none of the players see the pickupname, something with ownership must be wrong.
I tested it without the Condition, and then the OnRep is called. So it has to do with the ownership.
What am I missing to make sure the pickup that is overlapped with the player is the owner of the actual player that overlaps with it?
Kind regards,
Nick