How can I display the players seperate HUDs in local splitscreen multiplayer?

Hey everyone, I’m having an issue with getting my HUD’s to display correctly. I have Two player characters, two player controllers and two HUDs. They’re almost pretty much identical, however I’ve been trying to do a couple of things:

  1. Get player two to stop using player 2’s HUD
  2. Get player two to use their own characters instead of using player one.

I’ve been messing around with player indexes but to no avail. I’m really in need of some advice in getting player two to use their own stuff instead of player one. I know player one can take damage and die, however it’s not reflected on their HUD. However if they shoot player 1, their HUD will display as player 1’s and display the exact same data. So if player 1 was shot to 0 HP, player 2 would display 0 HP on their screen.

My game is fairly simple, however it’s my first time trying split screen multiplayer so any help and advice would be appreciated!

HUD is generated for each PlayerController, as each player has it’s own PlayerController which possess each pawn tha player controls. There for you should control HUD from PlayerController from it refrence inside this class or from HUD get data using Get Owning Player Controller or Get Owning Pawn and as you use them like that and don’t relay on global scope data (you mentioned player indexes) and such work out by it’s own. But i’m not 100% if this is how it works with splitscreen as i din’t play with it yet, if both HUDs for both players a drawed

How would I go about referencing it to that player controller though? Would I be casting it? That just seems to draw data to a HUD rather than assigning a HUD?

Is there an “assign HUD” function or something similar??

The answer is probably really simple, I’m just too noob to notice :stuck_out_tongue:

Are there any blueprint examples of local multiplayer with each player having their own HUD?

Also I can’t seem to find “Get Owned PlayerController” just “Get Owner”. “Get Owned Pawn doesn’t exist either” :S

Set hud class in player controller class and it will set up the hud

Sorry “Owning”

I’m assuming I have to code it in myself or expose it to Blueprint?

EDIT Turns out you need to turn off context sensitive when searching in the menu!*

Okay so here is my set-up. I know it draws to a single HUD and now I’ve found “Get Owning Player Controller” and “Get Owning Pawn”, I have no idea what to do to set the class.

So the character class has the typical health set up as displayed below.

The Blueprint interface is all hooked up like so.

14808-bpi_setup.png

And as you can see the BPI is called here to update health.

So obviously when I set my game up, and choose one of the ships huds I get this (Player 0 is a red HUD and player 1 is a blue HUD, I’ve also tested it with HUD as the default class in which it draws neither of the HUDs) Which comes to the playercontroller, which is going to be controlling it.

This is what I have found in the playercontroller class, but I’m stumped whether I should make this into a construction script, regular event script or even create a function. I’ve also been hooking them up to try and set the HUD but to no avail still. Either I get Errors/Warnings and it still won’t show.

14815-getowninginplayercontroller.png

(Sorry, had lots of trouble uploading screenshots!)

In this section here:

you are getting the player character for player 0, not for the owning player. Make sure you aren’t using that setup elsewhere as well, otherwise it will always reference the first player, not the one it should! :slight_smile:

It worked! Thank you so much! :smiley: <3

Awesome :slight_smile: