CrimsonSkillTree · Lesson 3 of 6

Add the Manager to Player State

Beginner4 minSetupBlueprints

Before you start

  • Completed: Enable the Plugin
  • A Player State you can edit (ideally on ACrimsonModularPlayerState)
Video coming soon

Chapters

Where the manager lives

UCrimsonSkillTreeManager holds the runtime state — unlocked nodes, point budgets, everything. Put it on the Player State so it replicates with the player and survives pawn respawns.

Why not the Pawn?
On the Pawn, a death/respawn would wipe progression. The Player State persists across respawns and replicates to the owning client.

Add the component (Blueprint)

Open your Player State Blueprint, click Add Component, and search Crimson Skill Tree Manager. Add it — it replicates automatically because the Player State does.

Player State Blueprint → Add Component → Crimson Skill Tree Manager.

Add the manager (C++)

cpp
// MyPlayerState.h
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
TObjectPtr<UCrimsonSkillTreeManager> SkillTreeManager;
// MyPlayerState.cpp
AMyPlayerState::AMyPlayerState()
{
SkillTreeManager = CreateDefaultSubobject<UCrimsonSkillTreeManager>(TEXT("SkillTreeManager"));
}

No manual initialization

There's no init function to call. The manager initializes itself in BeginPlay once the owner is ready — we'll give it trees to manage two lessons from now. For now it just needs to exist on the Player State.