I cant figure out what im doing wrong here. Use is a multicast function, associated container is a pointer that is only set on the client but not replicated, and the actor associatedcontainer is pointing to is a clientside only actor. this little snippet of code
void AInstancedItem::Use_Implementation(APawn* Pawn)
{
if (AssociatedContainer->IsValidLowLevel())
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Instance Number: %d"), InstanceNumber));
if (AssociatedContainer->InstancedMesh->RemoveInstance(InstanceNumber))
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Works!")));
}
else
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Doesn't work!")));
}
}
}
seems to work, it returns fine and prints to the screen and the instance number is the correct instance, but the instance isnt deleted