Animate runtime progress bars with UI Toolkit
Before you can add this to your game, you will need a full screen UI Container. In UI Builder, go to File > New. Click on **
Next, you will add the progress bar to the center of the screen. In the Library section, click on the Project tab and expand the tree view until you find Progressbar_Straight_Border.uxml. Drag it into the Hierarchy. Click on it, and set the following properties:
Save the file and call it LoadScreen.
You may want to have the loading progress bar appear on top of a nice full screen image. To do this, first add a new VisualElement to the LoadScreen root and set Background > Image to your sprite. Progressbar_Straight_Border should be a child of your new VisualElement.
UI Toolkit comes with a new component/game object type called UI Document. Add it to a new, empty scene by going GameObject > UI Toolkit > UI Document. Rename it to ProgressBar.
In your scene, you should now see a game object with a UI Document component. The Component has three properties:
There is only one property to change. Set Source Asset to LoadScreen. Push play and you should now see a static progress bar on the bottom of your Game window.