I’m not exactly sure what Alexander Muscat is planning to call the next iteration of his game WORLD4; but that hasn’t stopped me helping him develop some expansions to the game’s split-screen system.
Functionally this script is fairly straightforward. It controls the rect transforms of 4 separate cameras by splitting along either the horizontal or vertical axis. With the second and 3rd splits you can select which camera view you’d like to divide. Doing it this way, you could very easily modify the script to run recursively; and theoretically have unlimited split views.
The main drawback of splitting the views with this method is that it limits you to square windows. Using the stencil buffer would allow you to get all sorts of wacky shapes and transitions, but is a lot more involved. Plus as a bonus from doing it this way, Unity manages the field of view for each camera on it’s own.
I’ve also been experimenting with ways to control the splitting as the player explores the environment.
Currently I’m using trigger volumes to adjust the layout as the player moves around the environment.
It’s pretty rudimentary at the moment and doesn’t deal well with overlapping inputs, but I’ll wind up redoing this at some point. I’ll probably also get around to creating some custom editor tools to make the splitting a bit more useable.