# Getting verse UI/HUD to track and display on all players

**URL:** <https://forums.unrealengine.com/t/getting-verse-ui-hud-to-track-and-display-on-all-players/1310389>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [September 24, 2023, 2:55pm UTC](https://forums.unrealengine.com/t/getting-verse-ui-hud-to-track-and-display-on-all-players/1310389 "2023-09-24T14:55:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NotRekss](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/notrekss/32/755044_2.png) [@NotRekss](https://forums.unrealengine.com/u/NotRekss)\
**Post date:** [September 24, 2023, 2:55pm UTC](https://forums.unrealengine.com/t/getting-verse-ui-hud-to-track-and-display-on-all-players/1310389/1 "2023-09-24T14:55:10Z")

</div>

Trying to have my health/shield bar track all players and display for everyone, but I cant figure it out, currently it tracks the first player in the players array and thats it, how do I fix that?

```auto
OnBegin<override>()<suspends>:void=
        # var players: []player = Self.GetPlayspace().GetPlayers()

        # if(ValidPlayer := players[0]):
        # AddUIToPlayer(ValidPlayer)

        AllPlayers := GetPlayspace().GetPlayers()

        if (Player := AllPlayers[0]):
            AddUIToPlayer(Player)
        loop:
            Sleep(0.1)
            if(Player : player = AllPlayers[0]):
                if(FortniteCharacter: fort_character = Player.GetFortCharacter[]):
                    set healthFloat = FortniteCharacter.GetHealth()
                    set shieldFloat = FortniteCharacter.GetShield()
            UpdateUI()
            if(healthFloat <= 0.0):
                break

    AddUIToPlayer(Player:agent) : void=
        if (PlayerUI := GetPlayerUI[player[Player]]):
            PlayerUI.AddWidget(CreateUI())

```

---

<div class="post-metadata">

**Author:** ![LoPing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loping/32/737300_2.png) [@LoPing](https://forums.unrealengine.com/u/LoPing)\
**Post date:** [September 24, 2023, 11:32pm UTC](https://forums.unrealengine.com/t/getting-verse-ui-hud-to-track-and-display-on-all-players/1310389/2 "2023-09-24T23:32:32Z")

</div>

> [@NotRekss](#):
>
> ```auto
> if (Player := AllPlayers[0]):
> AddUIToPlayer(Player)
> 
> ```

The above specifically adds it to JUST the first player.

This may help:

```auto
    var PlayersCustomCanvas: [player]canvas = map{}

[...]

# after building a canvas 'NewCanvas' I give each player their own copy

        for (thisPlayer: Self.GetPlayspace().GetPlayers()):
               # lots of stuff deleted
                if:
                    set PlayersCustomCanvas[thisPlayer] = NewCanvas
                    # lots of stuff deleted
                then:
                    SetCanvasVisiblity(thisPlayer, true) 
                  # lots of stuff deleted

    # hide/display the Custom UI canvas    
    SetCanvasVisiblity(thisPlayer: player, bVisible: logic): void =
        if (CustomCanvas := PlayersCustomCanvas[thisPlayer]):
            if (bVisible?):
                CustomCanvas.SetVisibility(widget_visibility.Visible)
            else:
                CustomCanvas.SetVisibility(widget_visibility.Hidden)
```

You have to map a canvas to each player, and assign each player their canvas. I cannot recall if I HAD to make the canvas visible at the start, but I turn it on and off, so I may have turned it on at first for clarity.

---

<div class="post-metadata">

**Author:** ![NotRekss](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/notrekss/32/755044_2.png) [@NotRekss](https://forums.unrealengine.com/u/NotRekss)\
**Post date:** [September 25, 2023, 5:29pm UTC](https://forums.unrealengine.com/t/getting-verse-ui-hud-to-track-and-display-on-all-players/1310389/4 "2023-09-25T17:29:04Z")

</div>

Hey so I tried it but now my script is not working what so ever? Is there any way I could get in contact with you directly to look into it further, whether it be discord or twitter dms or something? this is something I gotta figure out and my script has changed since this post, my discord account is reksarts, if you’re willing to help me out with this.

---

<div class="post-metadata">

**Author:** ![LoPing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loping/32/737300_2.png) [@LoPing](https://forums.unrealengine.com/u/LoPing)\
**Post date:** [September 25, 2023, 6:27pm UTC](https://forums.unrealengine.com/t/getting-verse-ui-hud-to-track-and-display-on-all-players/1310389/5 "2023-09-25T18:27:05Z")

</div>

You need to break the problem down into small pieces and test each one before trying to do something that complex.

Can you put a simple text HUD on each player that says, “Player 1”, “Player 2”, etc.? Because if you cannot do that, then something complex like doing your own health and shield bars will not happen.

Use “**var Canvases: [player]canvas = map{}**” to load a “Player 1”, “Player 2”, etc. canvas on each player and I can tell you the next step.
