Forum Discussion

flarb's avatar
flarb
Partner
9 months ago

Anyone got a simple example of a mobile HUD?

I find the Horizon Worlds HUD example absurdly complicated. Anyone have a simple example of a mobile friendly HUD in TypeScript?

8 Replies

    • flarb's avatar
      flarb
      Partner

      Thanks! Lots of cool stuff here--don't really see any HUD examples. Some examples on how to use custom UI stuff...but I'm looking to find how to attach a screen-space HUD to each player as they join which is refreshed with local data. There are a few of these in the sample projects but they are absurdly complex. 

      Lots of interesting code snippets here, though!

      • T00NAH's avatar
        T00NAH
        Member

        TypeScript/Java is absurdly complex, especially to our own OG Programmers who grew up before Java. What those examples actually do is help make it more learnable/useable for a newcomer like myself. TypeScript is not a weekend fling. If you wish to learn enough to Create, you have a great environment for it. If you wish to copy/paste, buyer beware. 

         

  • Have you tried any of the template/tutorial worlds. There's something that displays ammo/magazine, also I've seen one that shows hp. Ultimately, HUDs are specific data displays. As a creator, learning how to utilize the vast array of data is the core of what makes my builds what they are. The CUI tutorials and examples have made a massive difference (for me).

  • My issue with the HUD stuff in the examples is they are tied to so much world-specific code it's really hard to try and migrate them to your own world. I kind of figured one out and managed to use some of the concepts to build my own HUD system although it doesn't quite work yet.

  • Ben.SH's avatar
    Ben.SH
    Community Manager

    Stay tuned for some HUD specific live events coming very soon.

  • The player HUD logic is exactly the same as a regular in world CUI. The difference is the configuration in the properties panel. By default, the <Display Mode> setting in CUIs is Spatial. But the Screen Overlay option snaps the CUI to the player's screen (for VR players the CUI will float covering part of the POV).

    There are 3 additional configurations for Screen Overlays:

    • No Interaction: as the name implies, this is just to display information without expecting player inputs.
    • Interactive, Blocking: You can configure buttons on the screen, but the player won't be able to move.
    • Interactive, non-Blocking: Same as above, but the player will keep the locomotion movements.

    Here's some documentation:

    https://developers.meta.com/horizon-worlds/learn/documentation/desktop-editor/custom-ui/noninteractive-custom-ui-screen-overlay

    https://developers.meta.com/horizon-worlds/learn/documentation/desktop-editor/custom-ui/interactive-custom-ui-screen-overlay