Forum rules - please read before posting.

Circular loading

Hello. How to make a circular loading bar. Below is a screenshot of the loading:
https://ibb.co/8NytD7Y
I created a boot menu for this lesson:
https://www.adventurecreator.org/tutorials/creating-loading-bar
Below is a screenshot of where I use Unity Ui Prefab:
https://ibb.co/pJLqJf9

Comments

  • edited April 2019

    Only a Slider can connect automatically to the loading progress. For anything else, you need to access it through script:

    KickStarter.sceneChanger.GetLoadingProgress ();
    

    For a circular sprite, select the UI Image component, set the Image type to Filled and the Fill Method to Radial 360. You can then use the Fill Amount sider to control how much is then shown. Such a technique is shown here.

    To map this slider's value to the loading progress, you can use a simple script:

    using UnityEngine;
    using UnityEngine.UI;
    using AC;
    
    public class SetLoadingSliderAmount : MonoBehaviour
    {
    
        public Image image;
        public float totalFactor = 0.6f;
    
        void Update ()
        {
            image.fillAmount = totalFactor * KickStarter.sceneChanger.GetLoadingProgress ();
        }
    
    }
    

    Place that in a C# file named "SetLoadingSliderAmount", attach to your Image and assign the Image component in its Inspector. You may need to tweak the Total Factor / Fill Origin values a bit to get it just right.

  • Thanks for the script. Everything is working.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.