Download

Toggle Splitscreen at Runtime Problem (bSetDisableSplitscreenOverride)

Hi,
I want to toggle splitscreen at runtime, read a few tutorials and got it working.
But it only works in PIE and not Standalone/Packaged.
Any ideas what could cause this?
UE4.19

Header:



#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "TestFuntionLibrary.generated.h"

UCLASS()
class SHIRO_011_API UTestFuntionLibrary : public UBlueprintFunctionLibrary
{
    GENERATED_BODY()

        UFUNCTION(BlueprintCallable, Category = "Viewport")
        static void DisableSplitScreen(AActor* Context, bool bDisable);
};


CPP:



#include "TestFuntionLibrary.h"

void UTestFuntionLibrary::DisableSplitScreen(AActor* Context, bool bDisable)
{
    if (Context)
    {
        Context->GetWorld()->GetGameViewport()->SetDisableSplitscreenOverride(bDisable);
    }
}


Thanks in advance and
have a nice day.

Nevermind, found the problem.
Somehow my DefaultEnginine.ini had *bUseSplitscreen=false *under *[/Script/EngineSettings.GameMapsSettings] *set to false.
Just set it to *bUseSplitscreen=true true *, solved my problem