This addon provides the boilerplate for a standard 1-4 player splitscreen viewport setup. It can add/remove players on-the-fly and responds to changes in window size.
Made for Godot 3.1
First, instance `res://addons/organicpencil.splitscreen/splitscreen.tscn` somewhere in the tree.
Set desired `border_width` and `vertical`.
# Add a player. Possible values 0 – 3. Returns a TextureRect with some extra goodies attached
var render = $Splitscreen.add_player(0)
# Assign a camera to the viewport
var cam = Camera.new() # Probably want to store a ref to this camera so you can move it later
# Add your HUD
var hud = preload(“res://path/to/my_hud.tscn”).instance()
# Player 2
render = $Splitscreen.add_player(1)
Cleaning up when a player leaves:
The viewport can be moved to a different parent if you need to change worlds
var viewport = $Splitscreen.get_player(0).viewport
– The borders aren’t actually drawn, so you can just throw whatever behind it to change the color.
– You may want to change the settings in `addons/organicpencil.splitscreen/player_viewport.tscn`, depending on your project.
Only logged in customers who have purchased this product may leave a review.
- Store Name: Official Godot Asset Library
- Vendor: Godot Asset Library
- No ratings found yet!