Widget Component and "SetHiddenInGame"

Created a actor blueprint with a widget component.

Calls to SetActorHiddenInGame on the actor do not hide the widget component.

Edit : This was my fault → Calls to SetHiddenInGame directly to the widget component allow it to be hidden but it cannot be shown again once hidden.

Hello MrCoder,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean proejct?
  2. If so, could you provide a detailed set of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved?

I just replicated part of this on a fresh “First person” game.

Create a new Blueprint class called “Test1” and a new Widget class called “Text”.

In “Text” delete the canvas and add a “Text” element.

In “Test1” add a static mesh component, make it the default root node and assign it to the 1M_Cube mesh. Then add a Widget and make it screen space and a widget class of the “Text” widget you just made.

Drag an instance of the “Test1” BP in to the level and add the following to the level blueprint.

75962-365159.png

Now hit play.

Press “E” once and the cube is hidden but the text remains on the screen. Press “E” again and the cube is shown along with the text.

Edit : Please read my last comment, the following was all my fault!

I then went on to try to replicate the second part of the bug (Calls to SetHiddenInGame directly to the widget component allow it to be hidden but it cannot be shown again once hidden) but I could not.

This level blueprint will hide and show the text as expected. (But surely hiding the Actor should do this by default?)

I wondered if the second part of the bug is caused by me using a child blueprint class.

I created a “Test1_Child” blueprint child of the parent to test this theory and dragged it in to the level, duplicated the level blueprint and could still not replicate the behavior I mentioned from my project.

Turns out after looking at my project I was doing this… But doing this in the clean project it does not even hide the “Text”. Maybe I am doing it wrong?

The node with the breakpoint does get hit by the way :slight_smile:

Thanks in advance.

By the way, here is the function I am using in my own project that is displaying the behavior described in the original post.

In all the examples I have provided the “Widget Component” is always a child of the “Static Mesh” within the blueprints I have made and the “Static Mesh” is always the root node of the blueprint.

Well I feel stupid in part!

In my own project the text was not showing again since I am working on a multiplayer game and it was not firing the “Set Hidden In Game” to show the text on the client after it had been hidden, it was only executing on the server!!

Hence I could not replicate it in a fresh project!

But I still think that showing / hiding the widget components should be included within the “Set Actor Hidden In Game” unless it is not by design for some reason?

Hello MrCoder,

I tried this in 4.11 and was unable to reproduce this result on our end. Could you provide the sample project that you are using so that I can get a closer look at your issue?

Hi Rudy, here is the most compressed version I could make of the example.

This is in 4.10.2.

Once you open and play pressing “E” will execute the level blueprint that will show/hide the cube, but not the text.

link text

I was able to reproduce this issue on our end. I have written up a report (UE-26114) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Workaround: You can get a reference to the widget component and you can set it to hidden in game directly

Make it a great day

Do you know when/if this bug is about to be fixed? I have a lot of screen space widgets in my project, and it’s extremely annoying that they won’t be affected by the “Actor Hidden In Game” function. Sure, you can work around it, but it’s quite frustrating and time-consuming.

Regards, Accel.

Hello ,

I have provided a link to the public tracker. Please feel free to use the link for future updates.

Link: Unreal Engine Issues and Bug Tracker (UE-26114)

Make it a great day