Custom loading bar
Re: Custom loading bar
Sorry, add .ToString() to the end of the line. See my edit above in my previous post.
Re: Custom loading bar
Sorry man..
I edited my post before yours , hoping that you would read the edit/update..
I did that already, and that did clear the error. But the value just stays at 0% while the bar moves correctly..
I out that script on the UI created text gameobject
I edited my post before yours , hoping that you would read the edit/update..
I did that already, and that did clear the error. But the value just stays at 0% while the bar moves correctly..
I out that script on the UI created text gameobject
Re: Custom loading bar
As a test, try setting the line to this:
It should show the progress number in the range 0.0 to 1.0. If that works, then please post your copy of the previous script with the Mathf.Clamp part.
Code: Select all
progressText.text = SaveSystem.currentAsyncOperation.progress.ToString();
Re: Custom loading bar
Thank you for spending time on this one Toni.. I really appreciate it..
I thought it was easier to just show you a video..
I thought it was easier to just show you a video..
Re: Custom loading bar
Hmm, that looks like it should work. Are there any errors or warnings in the Console window?
Try adding some debug lines:
Try adding some debug lines:
Code: Select all
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class LoadingProgressText : MonoBehaviour
{
IEnumerator Start()
{
var progressText = GetComponent<UnityEngine.UI.Text>();
while (true)
{
if (progressText == null)
{
Debug.Log("No Text element");
}
else if (SaveSystem.currentAsyncOperation == null)
{
Debug.Log("SaveSystem.currentAsyncOperation is null");
}
else
{
progressText.text = Mathf.Clamp(SaveSystem.currentAsyncOperation.progress * 100f, 0f, 100f).ToString();
}
yield return null;
}
}
}
Re: Custom loading bar
This is what i get..
Line 25 is:
Line 25 is:
Code: Select all
progressText.text = Mathf.Clamp(SaveSystem.currentAsyncOperation.progress * 100f, 0f, 100f).ToString();
Re: Custom loading bar
I received an notification that a new post from you but I don’t see it??
Re: Custom loading bar
The script did not paste properly into my previous post. Please try the script again, using the edits I made to it.
Re: Custom loading bar
If you just want a copy that works, instead of learning the scripts for now, here's a working loading screen with slider and percent text:
DS_InvectorLoadingScreenWithProgress_2021-12-01.unitypackage
DS_InvectorLoadingScreenWithProgress_2021-12-01.unitypackage
Re: Custom loading bar
So i just add this new loadingscreen to the build.
And is it only in the SAVE SYSTEM prefab in the loading sreen name i change the name to the new name?
Or is there more places?
Because i am getting below error
And is it only in the SAVE SYSTEM prefab in the loading sreen name i change the name to the new name?
Or is there more places?
Because i am getting below error