RealDocs

ULocalPlayerSubsystem

class Engine Since 4.22
#include "Subsystems/LocalPlayerSubsystem.h"
Access: public Specifiers: UCLASSAbstract

Description

Subsystem base class scoped to a `ULocalPlayer`. Useful for per-player UI state, input profiles, or anything that must be separate for split-screen players. Retrieved via `ULocalPlayer::GetSubsystem<T>()` or through the owning player controller.

Signature

UCLASS(Abstract, Within=LocalPlayer) class ULocalPlayerSubsystem : public USubsystem

Caveats & Gotchas

  • Only exists for local players — remote players in a multiplayer session do not have a ULocalPlayer on the server, so this subsystem is absent there.
  • Override `PlayerControllerChanged` to react when the owning local player switches controllers (e.g. after seamless travel).

Example

Access via local player C++
if (ULocalPlayer* LP = Cast<APlayerController>(GetController())->GetLocalPlayer())
{
    UMyUISubsystem* Sub = LP->GetSubsystem<UMyUISubsystem>();
}

Version History

Introduced in: 4.22

Version Status Notes
5.6 stable
5.0 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.