x

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"

Remove HUD from client after dying on server

So I have a basic kill and respawn system where the player will take 4 hits and then "die", in that i delete the pawn's actor and wait 5 seconds and then spawn and posses another one. All of this works on the server, client can kill server, server can kill client, but what I want to do is remove the hud or make it invisible when the player dies, then make it visible again when they respawn. I was able to get it working properly for the server, but whenever I try to do it for the client i am getting a "none" error when I try to access the HUD widget. Where exactly am I supposed to call the HUD remove stuff? In the Any Damage pipeline? In the server code for the respawn stuff? I guess I don't understand exactly where the HUD exists on the server?

Product Version: UE 4.10
Tags:
more ▼

asked Nov 23 '15 at 01:06 AM in Blueprint Scripting

avatar image

Zarrey
39 9 13 18

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

1 answer: sort voted first

Since the player controller doesn't replicate, you won't be able to get the player controller's HUD with the method you've described. However, if you build a listener into the HUD that checks for a gamestate (gamestate's do replicate), then the HUD can react to whatever the gamestate is. So for example, when my Gameplay HUD widget ticks, it checks the custom gamestate which has an enumerator in it with different states (playing, game over, loading, etc). If the gamestate enumerator equals game over, the widget removes itself. Not sure if this is the most efficient way of doing things, but has worked for me thus far.

more ▼

answered Jan 11 '16 at 11:35 PM

avatar image

paradoc
1.2k 49 31 86

(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