Forum Discussion

stealthbazatlantika's avatar
5 months ago

Custom UI - Multiple Screens

I am attempting to make multiple UI screens for a mobile first world. (2 initial UIs, then a HUD)

My plan had bee to make 3 custom UIs, and then a UIController class that would keep track of an enum as my "UIState" and then given a state, it would set one of the 3 UIs visible and the others not visible.

I have been plagued by hours of frustration as things don't ever seem to work.
* I can't seem to get the UIs to enable/disable as I want.
* I can't always preview UIs effectively in editor.
* I've been a bit confused and have thrashed  over issues like:
  * when should I be using local mode on UI scripts, or my UIController object?
  * what is the expected effect of UIs when you view them just by turning on world sim in editor.. vs once you hit play and a player joins..vs if you view them in a browser / on mobile?
 
Is a UIController, which has props pointing to the 3 custom UI entities, with the intent of IT telling them to enable/disable the UIs when I tell the UIController to do so... is that approach even wise?
  

For any vets who have made multi-screen UIs , how would you go about structuring this?
Got any broad tips that may guide me out of my forest of frustration?


1 Reply

  • I don't see anything wrong with it, but to answer some of your questions..

    Local UIs are only necessary if you need to reduce response latency, or use one of the systems that require local scripting like 

    fromPlayerAvatarExpression(player, expression)

    Local UIs require 1 UI per player. Without local UI then you can just use 1 UI and take advantage of the binding set method's optional parameter player array to dictate who gets the update.

    The expected behavior of UI when you start the world varies depending on whether you're working with a spatial UI or a screen overlay UI.