Announcement

Collapse
No announcement yet.

TPS split screen issues ...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    TPS split screen issues ...

    I have been developing a third person shooter and currently just have a single player mode. I want to add split screen functionality, but every time i create a new player from the UGameplayStatics::CreatePlayer(index, bShouldSpawnPawn): it creates the second player and his pawn fine, but then the first controller automatically un possesses its pawn and becomes a spectator... Wondering if anyone else has had a similar problem with split screen functionality ?? Any help is appreciated!

    #2
    Originally posted by callen55047 View Post
    I have been developing a third person shooter and currently just have a single player mode. I want to add split screen functionality, but every time i create a new player from the UGameplayStatics::CreatePlayer(index, bShouldSpawnPawn): it creates the second player and his pawn fine, but then the first controller automatically un possesses its pawn and becomes a spectator... Wondering if anyone else has had a similar problem with split screen functionality ?? Any help is appreciated!
    No directly an answer, but the "bShouldSpawnPawn" is actually not spawning a Pawn but a PlayerController.
    Found that out last time I digged into the Source Code of the BlueprintNode.
    The call ends in creating a PlayerController for that Player.

    Is that maybe a hint to you what could go wrong?
    Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

    My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
    (Including 100+ Pages Multiplayer Network Compendium to get you started.)

    Comment


      #3
      I Realized that myself when experimenting with different outcomes when checking the box. If you dont check 'spawnPawn' then half the screen is left blank, as if it didnt create the player controller
      Another strange issue is when i toggle splitscreen mode, and then remove the player, as soon as i begin the match, i control the desingated pawn for about 3 seconds and then my controller un posesses the pawn and becomes a spectator... ? Is there a different way to add splitscreen to your game that i am missing ?

      Comment


        #4
        Originally posted by callen55047 View Post
        Is there a different way to add splitscreen to your game that i am missing ?
        Maybe setting things up in BP first / watching this primer will help with the workflow:

        In PlayerController:
        Add Gamepad Special Right -> call Spawn-Character custom event (Pass a ref to PC).

        In Gamemode:
        Add Spawn-Character custom event -> Create Player -> Spawn Actor -> Possess (using PC ref)

        (Its easy to follow above except 'Skip assigning Gamepad to Player 1' tickbox didn't work for me).

        Comment


          #5
          Overall it seems like C++ is a must for Split-Screen, but maybe someone knows:

          #1: In BP, how do you unCreate Player... There's no node for that.
          (Cancel Split-Screen and revert viewport to fullscreen single-player view...)

          #2: In BP, how do you let 1-4 players choose the quadrant they want.
          (Associate 'Create Player' split-screen windows with specific controllers etc..)

          Comment


            #6
            Originally posted by franktech View Post
            Overall it seems like C++ is a must for Split-Screen, but maybe someone knows:

            #1: In BP, how do you unCreate Player... There's no node for that.
            (Cancel Split-Screen and revert viewport to fullscreen single-player view...)

            #2: In BP, how do you let 1-4 players choose the quadrant they want.
            (Associate 'Create Player' split-screen windows with specific controllers etc..)

            To answer your questions above:
            #1 - theres a node called "RemovePlayer" which takes the player controller reference in which to remove, and a bool if you want to destroy the pawn or not.
            #2 - The engine automatically splits the viewport into 4 even squares. If there are 3 players, you can change whether to favour the top or bottom screen in the project settings menu.

            Comment


              #7
              Ive tried narrowing down my problem, and it seems like the default pawn class for my player controller gets reset or erased when I add another player. Does anyone know how to set or reset the default pawn class for a Player Controller ? Other than just setting the default pawn class in the game mode.

              Comment

              Working...
              X