Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Horizontal Split-Screen with the Input Manager

Discussion in 'Input System' started by UltCIIT, Feb 24, 2020.

  1. UltCIIT

    UltCIIT

    Joined:
    Aug 12, 2018
    Posts:
    3
    I've been scouring the forums for the way to make the split screen work horizontally. Right now, the player cameras are just side by side and I want them stacked instead. I've been trying to set the Camera Rect but the Input Manager changes what I've placed. I've tried changing the Camera Rectangle fields on the Input Manager but that doesn't do what I want to happen.

    Is there any way to do it?

    Thanks!
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    The current subdivision scheme is fixed. But I think it definitely makes sense to have a top/bottom split as an option. Very straightforward extension. I've logged a ticket for after 1.0 (ISX-339).
     
  3. WilliamHerring

    WilliamHerring

    Joined:
    Aug 29, 2020
    Posts:
    4
    Not too sure but you might be able to manually set up a split screen script like this in your player script:

    Code (CSharp):
    1. public Transform cameraTransform;
    2. public playerCounter pc;
    3.  
    4. void Awake() {
    5. pc.playerJoined();
    6. cameraTransform.localScale = new Vector2(1, 0.5);
    7. if (pc.publicIndex == 1) {
    8. cameraTransform.position = new Vector2(0, 1);
    9. }
    10. if (pc.publicIndex == 2) {
    11. cameraTransform.position = new Vector2(0, -1);
    12. }
    13. }
    And create a game object with this playerCounter script:

    Code (CSharp):
    1. static int playerIndex;
    2. public int publicIndex;
    3.  
    4. public void playerJoined() {
    5. playerIndex += 1;
    6. publicIndex = playerIndex;
    7. }
    And then just disable the split screen option in Player Input Manager. Not sure if this will work but thought I might be able to help.
     
  4. AwesomePossum

    AwesomePossum

    Joined:
    Feb 15, 2014
    Posts:
    6
    I kinda almost got a horizontal split-screen working by changing the viewport rect on both players to .5 Y scale and on 1st player to .5 Y position, but I really don't like it because it's not dynamic at all and it doesn't seem to draw everything it's supposed to, like the first-person arms...

    Might be a way to make it work with a script, but I don't really know what I'm doing, haha. .
     
  5. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    I wanted to bump this. Any update on horizontal split screen? Would be a nice option to have.
     
    unity_zEzucK5-NmxgGA likes this.
  6. Skuxlife

    Skuxlife

    Joined:
    Nov 27, 2016
    Posts:
    4
    Easy to add. Ticket logged in 2020.
    Has this been added in 2023?
     
  7. snipshotmedia

    snipshotmedia

    Joined:
    Nov 13, 2023
    Posts:
    9
    Also looking for this
     
  8. JauntyBearGames

    JauntyBearGames

    Joined:
    Mar 26, 2018
    Posts:
    59
    Where is (ISX-339) ?