Parameterless call to get subsystem fails (Local player subsystem)

Is there a reason why parameterless “Get Subsystem” node fails if called from Actor Blueprint (Static Mesh Actor), but the version that takes player controller as a parameter returns correct subsystem instance?

So this fails, None is returned:

image

But this succeeds:

I really wouldn’t mind if I knew where I could find those getter implementations but Go To Definition opens up subsystem source files so I can’t check how those getters are implemented. My motivation here is to avoid complicating blueprints as much as possible, so I would prefer to call getter without any additional logic.

Just in case it matters, LootSubsystem is implemented in C++ and exposed to blueprints.

I think I solved this problem myself. Subsystem API can be found here:

There are two function signatures:

USubsystemBlueprintLibrary::GetLocalPlayerSubsystem(...);
USubsystemBlueprintLibrary::GetLocalPlayerSubSystemFromPlayerController(...);

GetLocalPlayerSubsystem assumes ContextObject is either UUserWidget, APlayerController or ULocalPlayer. It has code paths for each case to obtain LocalPlayer information from it and then it uses local player instance to obtain subsystem. But in my case context is AActor and path to retrieve subsystem from actor is not implemented.

So I guess this problem is solved, however if this is how its supposed to work I think you shouldn’t be shown this version in blueprints that are not derived from UUserWidget, APlayerController or ULocalPlayer.

1 Like