Forum begins after the advertisement:


[Part 9] Level + Time Survived Holders constantly displaying

Home Forums Video Game Tutorial Series Creating a Rogue-like Shoot-em Up in Unity [Part 9] Level + Time Survived Holders constantly displaying

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #11738
    P
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Having added both the Level Reached Holder and Time Survived Holders into their own respective groups (as per the video). They both will constantly display over the entire game while the game is active, when the player dies, the information will also update correctly.

    View post on imgur.com

    Also wanted to note that the player name holder does not update based on what is typed in the text field, it uses only the name of the character scriptable object.

    #11739
    P
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    GameManager.cs

        [Header("Results Screen Display")]
        public Image chosenCharacterImage;
        public TMP_Text chosenCharacterName;
        public TMP_Text levelReachedDisplay;
    
        public void AssignLevelReachedUI(int levelReachedData)
        {
            levelReachedDisplay.text = levelReachedData.ToString();
        }
    

    PlayerStats.cs

        public void Kill()
        {
            if(!GameManager.instance.isGameOver)
            {
                GameManager.instance.AssignLevelReachedUI(level);
                GameManager.instance.GameOver();
            }
        }
    

    Are the code for the elements that was added as well.

    #11740
    P
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    from around here

    #11743
    P
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    I need my eyes checked, I thought they were child gameobjects of the Results Screen, but they were not lol. Problem solved

    #11744
    P
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Although the other side-issue still remains, the CharacterScriptableObject name is what determines the name that shows up on the result screen, rather than the name that is typed into the text box.

    #11745
    Xavier Lee
    Level 16
    Keymaster
    Helpful?
    Up
    0
    ::

    Hi P, can you share your AssignChosenCharacterUI() method? I think the problem may be that instead of assigning the chosenCharacterData.Name, you are assigning the chosenCharacterData.name. A very easy mistake to make.

    #11746
    P
    Level 1
    Participant
    Helpful?
    Up
    0
    ::
        public void AssignChosenCharacterUI(CharacterScriptableObject chosenCharacterData)
        {
            chosenCharacterImage.sprite = chosenCharacterData.Icon;
            chosenCharacterName.text = chosenCharacterData.name;
        }
    

    You were right, the chosenCharacterData.name was lowercased. Man, making careless mistakes :(

    Thank you again, and always enjoying the tutorial!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: