Forum begins after the advertisement:


[Part 12] HUD not showing up after implementing this part

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 12] HUD not showing up after implementing this part

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17670
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::

    @theantagonist9319 has an issue with the HUD (health and mana) not showing after implementing Part 12.

    After following this code with regards to Canvas group alphas being set to 1, when I transition to Cave_2 from Cave_1, my canvas prefab’s alpha changes to 0 and the canvas is not visible in the new scene.
    #17671
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::

    After requesting for his project files and taking a look at his code, the issue turned out to be with the LoadScene() function in his UIScreen code. He has an extra line that sets his HUD’s alpha to 0.

    protected virtual IEnumerator LoadScene(int buildIndex, LoadSceneMode loadSceneMode, float fadeDuration = -1, float newTimeScale = 1f)
    {
        if(fadeDuration < 0) fadeDuration = fadeTime;
    
        //activate the fade to black
        yield return FadeTo(fadeColor, 1, fadeDuration);
        group.alpha = 0;
    
        transform.SetParent(null);
        SceneManager.LoadScene(buildIndex, loadSceneMode);
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: