Skip to content

Instantly share code, notes, and snippets.

@SamCarey99
Last active March 16, 2021 21:07
Show Gist options
  • Save SamCarey99/0020bd475e556c3615305747253537bd to your computer and use it in GitHub Desktop.
Save SamCarey99/0020bd475e556c3615305747253537bd to your computer and use it in GitHub Desktop.
using UnrealBuildTool;
public class MyProject : ModuleRules
{
public MyProject(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" });
PublicDependencyModuleNames.AddRange(new string[] {"PlayerStatistics"});
}
}
#include "PlayerStatsSubSystem.h"
void ATestStat::StatProgress()
{
UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(GetWorld());
UPlayerStatsSubSystem* PlayerStatisticsSubsystem = GameInstance->GetSubsystem<UPlayerStatsSubSystem>();
PlayerStatisticsSubsystem->AddToCounter(FName("ExampleKey"), 1.0);
}
@AstrixVRchat969
Copy link

Nice thx, ate stat::StatProgres()
{
UGameInstace* GameInstance = UGameplayStaticss::GetGameInstance(GetWorld());
UPlayerStatsSubSystem* PlayerStatisticsSubsystem = GameInstance->GetSubsystem();
PlayerStaticsSubsystem->AddToCounter(Fname("ExampleKey"),castString,"2.0-D

@adnoh
Copy link

adnoh commented Mar 16, 2021

@SamCarey99 should your example project link from ue marketplace "player statistics" really point here!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment