# UI is not persistent. Jumping from player to player???

**URL:** <https://forums.unrealengine.com/t/ui-is-not-persistent-jumping-from-player-to-player/1878252>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [May 29, 2024, 5:24am UTC](https://forums.unrealengine.com/t/ui-is-not-persistent-jumping-from-player-to-player/1878252 "2024-05-29T05:24:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Plzwork1234](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Plzwork1234](https://forums.unrealengine.com/u/Plzwork1234)\
**Post date:** [May 29, 2024, 5:24am UTC](https://forums.unrealengine.com/t/ui-is-not-persistent-jumping-from-player-to-player/1878252/1 "2024-05-29T05:24:07Z")

</div>

```auto
 RemCoreHealth_UI(Player:player):void=
        if(PlayerUI := GetPlayerUI[Player], temp:=CanvasMap[Player]?):
            PlayerUI.RemoveWidget(temp)

    Initialize(Player:player):void=
        if(PlayerUI := GetPlayerUI[Player]):
            tempCanv:=CreateUIForPlayer(StackBox_X,StackBox_Y)
            if(set CanvasMap[Player] = option{tempCanv}):
                PlayerUI.AddWidget(tempCanv)

```

```auto
CreateUIForPlayer(UIX: float, UIY: float):canvas=

        #GUIWidget.SetText(GUIText1())
        Blue_TextWidg.SetText(TextToMsg("{CoreHealth}"))
        Red_TextWidg.SetText(TextToMsg("{CoreHealth}"))

        MyCanvas : canvas = canvas:
            Slots := array:
                canvas_slot:
                    Anchors := anchors{Minimum := vector2{X := 0.00, Y := 0.0}, Maximum := vector2{X := 0.0, Y := 0.0}}
                    Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := 0.0}
                    Alignment := vector2{X := UIX, Y := UIY}
                    SizeToContent := true
                    Widget := stack_box:
                        Orientation := orientation.Horizontal
                        Slots := array:
                            stack_box_slot:
                                Padding:=margin{Top := 0.0, Left := Blue_UI_PaddingLeft, Right := Blue_UI_PaddingRight, Bottom := 0.0}
                                Widget := Blue_TextWidg
                            stack_box_slot:
                                Padding:=margin{Top := 0.0, Left := Red_UI_PaddingLeft, Right := Red_UI_PaddingRight, Bottom := 0.0}
                                Widget := Red_TextWidg

```

For some reason the result of this code is the UI jumping from player to player depending on who calls “Initialize” or “RemCoreHealth”. Like it is not persistent, or its not actually creating a new canvas for the player at “tempCanv”.  
What am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![TelesphorosGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/telesphorosgames/32/924355_2.png) [@TelesphorosGames](https://forums.unrealengine.com/u/TelesphorosGames)\
**Post date:** [May 29, 2024, 5:39am UTC](https://forums.unrealengine.com/t/ui-is-not-persistent-jumping-from-player-to-player/1878252/2 "2024-05-29T05:39:12Z")

</div>

This thread may have some answers for you :

> [@Verse UI - How to keep widgets on first players screen without second player removing them?](https://forums.unrealengine.com/t/verse-ui-how-to-keep-widgets-on-first-players-screen-without-second-player-removing-them/1279301):
>
> In my Verse UI canvas, any widgets that are defined outside of MakeCanvas() are removed from the first player’s screen when a second player presses a button device to display the UI canvas on their screen. I can’t just define all of my UI widgets inside of MakeCanvas(), because I need to reference some of the widgets for other functions. Could someone explain to me how to assign variables like UI widgets to only the player who presses the button device to initiate their own canvas, instead of t…

---

<div class="post-metadata">

**Author:** ![Plzwork1234](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Plzwork1234](https://forums.unrealengine.com/u/Plzwork1234)\
**Post date:** [May 29, 2024, 5:49am UTC](https://forums.unrealengine.com/t/ui-is-not-persistent-jumping-from-player-to-player/1878252/3 "2024-05-29T05:49:02Z")

</div>

Well conceptually it makes no sense. But I have seen that method before. I was trying to avoid making an entire class for such a simple UI, but I guess I dont have a choice. Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 28, 2024, 5:49am UTC](https://forums.unrealengine.com/t/ui-is-not-persistent-jumping-from-player-to-player/1878252/4 "2024-06-28T05:49:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
