Switch Named Slot Content (UMG)

Hello guys,
i’m not sure if this is a bug, but anyway:

Using Named slot, and setting its content runtime:

At the first call of “SetContentForSlot”, it’s all perfect: the new content is set up and displayed.

Howerver, on the successive calls:

Expected result:

At every new call, update the content accordingly.

Actual result:

The call doesn’t change the content. I have to call it 2 times to obtain the change, the first one with the content set as NULL, and the second with the intended new content.

Hello zamy,

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 project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved with this issue?

If i can reproduce it, i’ll link the source here

here we go.
Instructions:

  1. Create a new C++ basic project, without content, called ‘DebugBeginPlay’
  2. Extract the given zip in the folder
  3. regenerate, compile and run
  4. Open the level ‘NewMap’
  5. Run, and see that the button and the slot are working (using the workaround said before).
  6. Open ‘MainHUD’, go to the Graph.
  7. You can see, in the OnClick event of the button, that i commented the 2 blocks where i set the slot to NULL first. Try to exclude them linking the execution directly to the second ‘Set Content for Slot’.
  8. Compile and run again. As you should see, the slot content never changes.

Again, i’m not sure if it is a bug, but i would expect it to work without the commented (boxed) nodes.

[Source code][2]

Let me know if you have problems with the code :slight_smile:

Hello zamy,

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

I was able to get this working with the following set up. I hope this helps.

Make it a great day

Ok, thanks!