For all Unity developers and developers-to-be, both beginners and professionals!

Post tutorial Report RSS Splitscreen cameras

How to set cameras to simulate the splitscreen multiplayer mode in Unity.

Posted by on - Basic Other

First, duplicate your Main Camera (in the Hierarchy section, select your Main Camera object, then press CTRL + D)

You need to set both cameras appropriately.

The first camera, change
X (X coordinate) to 0
Y (Y coordinate) to 0.5 (starts from the middle of the screen, the Y position)
H (Height) to 0.5 (0.5 means 50%)

The second camera, change
X (X coordinate) to 0
Y (Y coordinate) to 0
H (Height) to 0.5 (50% of the screen)

You can look at the pictures below:

Main_Camera properties

Main_Camera2 properties

You also need to set Targets of these cameras - best to set the two characters as the targets. In the CarEdu project, both car objects' (Car, Car2) CenterOfMass elements were set as targets.

That's all if you mean creating the splitscreen multiplayer mode cameras. See the splitscreen input tutorial for setting up keys for two players:


Bad tutorial imho (not to be rude). This is just going to result in a console clogged with error messages ('There are 2 audio listeners in the scene'). Sure I could delete one of them, but that means Player 1 is going to hear sounds, and Player 2 is going to hear jack nada.
I think you really need to look into and research what it is you're attempting BEFORE you make a tutorial. I also think splitscreen warrants more than a 'basic' tutorial - after all, trying to figure out the whole audio mess is trickier than it first sounds.
Sure, it's easy to change the camera rect - anybody who bothers to read the documentation knows that.
As for the input tutorial, that is BAD PRACTICE - you NEVER just wholesave DUPLICATE a script for the sole purpose of changing a string!! Why not just expose the axis name as a property!? It's MUCH cleaner. Duplicating stuff like that will NOT land you a job in this industry, that's for sure.
Sorry. Rant over.

Reply Good karma Bad karma+1 vote

This comment is currently awaiting admin approval, join now to view.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Open to all members
Send Message
Join group
Group watch
Related Games
CarEdu Racing
Related Engines
Unity Commercial
Related Groups
Indie Devs
Indie Devs Hobbies & Interests with 1,475 members
Unity Devs
Unity Devs Hobbies & Interests with 1,646 members