Normal - Verse | HideHUDElements and ShowHUDElements effect ALL players, not the targetted player.

in my Verse UI script, Im using Show and Hide HUD Elements to control what the player can see on screen during cutscenes, etc.

However when I control those elements, it appears that it will effect all players. This is undesired!

Snippet:

HUDElements:[]hud_element_identifier = array:
            creative_hud_identifier_equipped_item{},
            creative_hud_identifier_health{},
            creative_hud_identifier_health_numbers{},
            creative_hud_identifier_interaction_prompts{},
            creative_hud_identifier_pickup_stream{},
            creative_hud_identifier_player_inventory{},
            creative_hud_identifier_shield_numbers{},
            creative_hud_identifier_shileds{}

HideHud(Agent:agent):void = {
        if (Player := player[Agent], PlayerUI := GetPlayerUI[Player]):
            PlayerUI.HideHUDElements(HUDElements)  # <------
            if:
                PlayerUIC := GetPlayerUI[Player]
                MyUI := MaybeMyUIPerPlayer[Player]?
            then:
                if (set MaybeMyUIPerPlayer[Player] = false) {}
                PlayerUIC.RemoveWidget(MyUI)

Hi @AxelCapek, the implementation of this API is meant to operate on all the players in a play space. It is unfortunate that the method is currently in player_ui as I’m sure this is the source of the confusion. We will soon change the API entry point to make it clear that this operates on all players and we will update the documenation of player_ui.HideHUDElements to note that it currently operates on all players.

It is also clear from your use case that there is a need to be able to hide and show HUD elements per-player and that is also something we may implement in a later release.

1 Like

Thanks for the response - I am using the HUD Controller Device as a workaround which has team filtering capabilities, not ideal as I’d like to do this solely through Verse.

Glad this is being discussed!

The lack of team filter in the verse api is also an omision that we will try to correct soon. This api is meant to do do exactly what the HUD controller device does.

3 Likes