MultiWorld  1.4.0
Manage multiple isolated UWorld instances simultaneously in Unreal Engine, transferring player and actors between worlds.
GetPlayerController bug in UE5.0.0-UE5.0.1

GetPlayerController bug in UE5.0.0-UE5.0.1

This issue has been solved by Epic in UE5.0.2: Notes below apply only to UE5.0.0 and UE5.0.1.

UE5.0.0 introduced a bug in the implementation of UGameplayStatics::GetPlayerController(), that no longer returns the correct UWorld instance from the passed World Context Object (it always returns the Active World instead). This applies only to UE5, not to UE4. Since this method is often used in Blueprints and C++, knowing the available workarounds is important.

Until Epic will solve this issue, in UE5 you MUST work-around this bug retrieving the Player Controller of a desired UWorld calling the method UGameplayStatics::GetPlayerState() and, on the returned Player State object, the method APlayerState::GetPlayerController().

The same issue applies also to the methods UGameplayStatics::GetPlayerPawn(), UGameplayStatics::GetPlayerCharacter(), UGameplayStatics::GetPlayerCameraManager(); and the same workaround MUST be used (i.e. retrieving the desired objects passing from UGameplayStatics::GetPlayerState()).

If you are working directly with the engine source code, alternatively you can back-out (part of) the linked changeset restoring the same behavior as in UE4. Of course this will remove also the fix provided by that commit, so analyze it carefully before proceeding with this option.