Switching between horizontal and vertical splitscreen at runtime

As the question suggests, is it possible to switch between horizontal and vertical split screen views based on certain conditions that can occur while the game is running?

I know there is an option to select the split screen orientation from the settings menu, but is it possible in game?

I would appreciate any help.

hmm… change the map settings in c++

auto Settings = const_cast<UGameMapsSettings*>(GetDefault<UGameMapsSettings>());
if (Vertical)
	Settings->TwoPlayerSplitscreenLayout = ETwoPlayerSplitScreenType::Vertical;
else {
	Settings->TwoPlayerSplitscreenLayout = ETwoPlayerSplitScreenType::Horizontal;

Sweet! I’ll give this a go as soon as I get back from work!