game_splitscreen.gd 285 B

12345678910
  1. extends Game
  2. func _ready() -> void:
  3. var player_2 := %Player2 as Player
  4. var viewport_1 := %Viewport1 as SubViewport
  5. var viewport_2 := %Viewport2 as SubViewport
  6. viewport_2.world_2d = viewport_1.world_2d
  7. player_2.camera.custom_viewport = viewport_2
  8. player_2.camera.make_current()