Sitemap
CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Make a 2D Split-Screen in Godot 4 [GDScript + C#]

A must-have for your next co-op racing game…

2 min readSep 24, 2025

--

Wanna make a local multiplayer game where all your players get their own view? Godot doesn’t have built-in split-screen support, but setting it up is super simple with multiple viewports! Each player gets their own camera to render the 2D world, and we stack all renders side-by-side.

Press enter or click to view image in full size

The essential trick here is to create multiple combos of SubViewportContainer and SubViewport nodes, one per player. In the first one, you’ll put your whole 2D scene, along with your first player and their camera. Then, in the other viewports, you’ll put your other players with their cameras (but DO NOT copy the 2D scene!):

Then, attach a script on your scene/game manager node. This script will take care of automatically “re-assigning” the 2D scene to the other viewports as well — don’t worry: this doesn’t duplicate it, but it will allow those other viewports to render it as well:

GDScript

# get 2D scene (= 2D world) to share
var world = $path/to/viewport1.find_world_2d()

# give it to render to the viewport of Player 2…

--

--

CodeX
CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Mina Pêcheux
Mina Pêcheux

Written by Mina Pêcheux

I’m a freelance full-stack web & game developer. I’m passionate about topics like CGI, music, data science and more! Find me at: https://minapecheux.com :)

Responses (1)