Marek Kost

Game developer

Setting up 2D is a little bit trickier, you have to create 2 sorting layers called Background and Foreground first.

Add 2 new sorting layers

Create a new scene or use one you already have if you are trying to integrate split screen into your game. My simple scene looks like this. I have a camera, background sprite and 2 sprites for players.

My sample scene

Assign your background sprites Background layer and sprites you will render on top (like players) Foreground layer. This is to ensure objects in your scene are rendered in proper order.

Next up you should remove cameras from your scene and click on Setup 2D.

Now you should have SplitScreenUI and SplitScreenCamera2D in your hierarchy.

I have created and added new TestPlayerController script to my “Players”, you can use whatever script you use to control your player.

Inside of the script you want to add 1 line in Awake() or Start() method.

My script looks like this

What next? Guess what, just press play. Look you have working split screen, imagine if your players could move, it would be great. 🙂


Post Author: marekkost

Leave a Reply

Your email address will not be published. Required fields are marked *