HasAuthority() on ActorComponent

Vinstand
Fri, 16 Dec 2022 20:03:49 +0000
C++

Hello, how can I use HasAuthority() inside an ActorComponent()?

void UInventoryComponent::AddInventoryItem(FItemData ItemData)
{
if (HasAuthority())
{
InventoryItems.Add(ItemData);
if (IsLocallyControlled())
{
OnRep_InventoryItems();
}
}
}

3 posts - 3 participants