Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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!

Product Version: Not Selected
more ▼

asked Aug 31 '14 at 10:35 PM in Blueprint Scripting

avatar image

173 37 33 44

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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

more ▼

answered Aug 31 '14 at 11:50 PM

avatar image

37.2k 936 172 1116

avatar image Kagamusha Sep 01 '14 at 09:17 AM

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 :P

avatar image Shadowriver Sep 05 '14 at 10:23 AM

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

avatar image Kagamusha Sep 04 '14 at 12:05 PM

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

avatar image Shadowriver Sep 05 '14 at 04:08 PM
avatar image Kagamusha Sep 08 '14 at 11:39 AM

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. alt text

The Blueprint interface is all hooked up like so. alt text

char_bp_setup.png (119.8 kB)
bpi_setup.png (34.2 kB)
avatar image Kagamusha Sep 08 '14 at 11:44 AM

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

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. alt text

hud_setup.png (65.7 kB)
avatar image Kagamusha Sep 08 '14 at 11:46 AM

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.

alt text

(Sorry, had lots of trouble uploading screenshots!)

avatar image Kashaar Sep 08 '14 at 04:27 PM

In this section here: https://answers.unrealengine.com/storage/temp/14812-hud_setup.png 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! :)

avatar image Kagamusha Sep 08 '14 at 04:37 PM

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

avatar image Kashaar Sep 08 '14 at 07:26 PM

Awesome :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question