Announcement

Collapse
No announcement yet.

Toggle Splitscreen at Runtime Problem (bSetDisableSplitscreenOverride)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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:
    Code:
    #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:
    Code:
    #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.

    #2
    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

    Comment

    Working...
    X