Hello everyone, I am working on setting up EOS for an online game.
I am at a part to set up stats, and I am having one line with error code and don’t know the fix.
The part I receive the error message is “(this, &UEOS_GameInstance::OnGetStatsComplete));” right at the end of the code. The error message shows " No viable function".
I checked the code in .h as well, but it seems that everything is set properly.
I am working with Unreal Engine 5.0.3 and IDE is Rider 2022.3.2.
void UEOS_GameInstance::GetStats(TArray StatName)
{
IOnlineSubsystem *SubsystemRef = Online::GetSubsystem(this->GetWorld());
if (SubsystemRef)
{
IOnlineIdentityPtr IdentityPointerRef = SubsystemRef->GetIdentityInterface();
{
IOnlineStatsPtr StatsPointerRef = SubsystemRef->GetStatsInterface();
if (StatsPointerRef)
{
TArray<TSharedRef> Usersvar;
Usersvar.Add(IdentityPointerRef->GetUniquePlayerId(0).ToSharedRef());
StatsPointerRef->QueryStats(IdentityPointerRef->GetUniquePlayerId(0).ToSharedRef(), Usersvar, StatName, FOnlineStatsQueryUserStatsComplete::CreateUObject(this, &UEOS_GameInstance::OnGetStatsComplete));
}
}
}
}