Having trouble figuring out why some set visibility nodes are not working

For some reason, whenever I try to run “testago” to change the visibility of a widget during gameplay, it seemingly does not trigger the two set visibility nodes, but still executes both print string nodes when the event is triggered. The print string node at the end is even effected by the 3 second delay node.

I’m super baffled as to why these nodes are not doing anything. I’ve got a set visibility node that works just fine in the widget’s event construct code chain, which makes this even more confusing.

Delay in a Loop does not work.


Instead:

  • make the widgets Visible in a loop as you do
  • call a Custom Event in the widgets which Delays the Collapse (each widget collapses itself)

Alternatively, use the Completed pin → Delay → Collapse (you’d need to loop again). Or, if there’s only one DeathScreen, do not use a Loop at all.


Hey! just tried to replicate what you’ve told me to do here as best as I can, but it’s still not making the widget appear on the screen when “testago” is triggered. Here’s an updated picture of the code I’ve got for this.

Add an input to RPC_DeathScreenDelay of type Deathscreen and then when you are iterating the loop and calling it pass in the item from the loop.
The use the passed input as the target for the set visibility

You can’t just cross the variable between client and server like that.
cross


Edit : forgot to pass it again in the lower left corner

1 Like


Ok, I tried implementing this, and It’s still not working. Although for some reason, if a specific client is killed, it makes the screen pop up on the hosts (the editor’s) instance of the game.

After looking more in depth:
Testago already is executing on all why are you bouncing back to server and then clients again?

You can skip Deathscreen Delay and just call RPC_DeathScreenDelay even without the executes on all (you are already calling it from an executes on all function to begin with). Then RPC_DeathScreenDelay doesn’t even need to be an RPC just a normal function.

Maybe the top level only checkbox is messing up the gathering of the widgets. Is the death widget nested inside of another widget?


I’m not really sure how one widget can get nested within another widget (or how that happens in the first place) but if it helps, here’s the code I’ve got that sets up all the widgets I’ve made so far.

Also, I tried editing the code to make RPC_DeathScreenDelay into a normal function, and while the problem still persisted, I’ve got a feeling it still helped regardless.

You need to migrate your code to the HUD class and set it there. Keeping all of this inside of the character is bad coding practice.

I’ll try to whip up a quick demo project to show the proper setup

1 Like

thank you!

fps_simple.zip (8.3 MB)

Set it to client 2 players and left click to line trace. When health goes to zero it calls a you died screen for all and after a set time removes it.

Sorry it took so long. Tried first with the first person template but It wasn’t really working well with replication.

Hey! sorry for the long wait inbetween my responses, but I just tried to open up your test project and for some reason i can’t see any of the blueprints in the HUD file within the editor. Also, the map won’t load in, so my editor only shows a black screen.

I dunno if it’s a difference in our versions of unreal, but i tried to import some of your blueprints in the HUD file manually into my other project, but unreal won’t let me do that since it doesn’t recognise the file type/extension “.uasset”

I also tried to put the files into my game’s content folder manually, but they still didn’t show up in my editor despite being in the project files in my file explorer :frowning:

Also, it’s ok if the demo project took a bit longer to make, as I’m just happy you made it in the first place <3

Which version of the engine are you working with? Must be an older version if the blueprints won’t show up.

im working with the latest version of unreal iirc. whenever i try to open your project, it prompts me to open up the 5.3 version of the engine

Strange the project is done in 5.4.2


most of the BP’s

I’ll upload it again
fps_simple.zip (8.3 MB)

There is not much going on in the scene. The characters are skinned boxes and the ui is simple. It’s just to demonstrate the mechanics.

1 Like

TYSM for making this!! I got it working on my PC now, and I feel that it’s gonna be super informative. I’ll keep you posted if it fully solves my issue, or if there are any more major issues that I run into.


Hey! Just wanted to report in to say that your demo project has helped immensely for fixing most of my widget problems, and My death screen now actually shows up when triggered!

Unfortunately though, I think there’s a bit of an issue in how how the code to trigger the screen is done across a network. As shown in the video, the server host client (for reference, this is being done on a listen server) can be killed without any issues when a “Get Player Controller” node is used as the target to show the death screen too. However, when a foreign client gets killed, the screen still shows on the host’s screen.

I tried swapping out the “Get Player Controller” node with a “Get Local Viewing Player Controller” node to fix the issue, and while it did fix the issue with the death screen showing on the host’s client, the death screen still won’t show up on the killed foreign client’s screen, and I get an error message when they die.

for reference, the error message in full is:
[Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetLocalViewingPlayerController_ReturnValue”. Node: Show Death Screen Graph: F Deathcheck Function: F Deathcheck Blueprint: BP_FPCharacter]

I think the “get player controller” node might not be working here because it’s only getting the index of the host’s machine (since the node’s index input is by default set to 0, which is also what the index of the host is in a multiplayer environment). I’m not sure though. Is there something I’m doing wrong here?

Hmm ok you didn’t mention that a listen server is involved that changes the situation a bit.
Just to clarify: you want the death screen to show up for everyone right?
Sort of like a coop mission failed status for the whole group when one of the players die.

Or should it be team specific (red, yellow, blue, green)?

Oh, I want it to show up whenever a player gets killed by another player.

It should show up on only the killed player’s screen, and nobody else’s when they die.

Ok that clarifies the situation. The it doesnt really need to replicate the widget. Just follow the health var on rep with condition owner only and you can use it to trigger on rep nofity when the player health gets to zero.

I’d do it myself but I’m not at my pc now

I’m… Not quite sure how to do that.

I’ve been trying to figure out what you mean by this, but I’m kinda stumped on how to implement it exactly. I’m really confused.

If it helps, here’s all the code I have currently in relation to how the death screen is triggered.