I have yet to build a serious BabylonJS application but I hope that will soon change! In preparation I’m exploring different patterns and tooling. One question I am wondering about is what approach do you use for UI. I come from a react/preact web app development background using redux, pub/subs, etc for state / user actions / server event data management. I have explored using BabylonJS and there’s various things I like. For example, when used in conjunction with the react-babylonJS package:
- the lifecycle management of the visual components seems very straight forward
- the syntax is familar
However as it’s a relatively new library there are various issues with it (it logs errors despite working without issue). Also BabylonJS (rightly) does not yet / will ever natively support various UI components so I’ve had to build custom UI components to get these functionalities. (Rightly because UI permutations are infinite and that seems an less fruitful avenue of work than the amazing 3D capabilities BabylonJS brings).
My current plan is use a hybrid approach: use a React / HTML overlay for most of the UI and to reserve BabylonJS UI for when it needs to sit within the 3D scene or in some way interact with it spacially, e.g. a health bar above a characters head, a speech bubble, or things like that.
So I’m wondering what people have found in their experience? What they had wished they’d known at the beginning or had to / wish they had done differently? Many thanks in advance. Links to blog posts also welcome. I have a follow up question on state / event / user interaction / client-server-multiplayer data management, so if strays into that too then please share!