#Brackey's Typing Game Tutorial

1 messages · Page 1 of 1 (latest)

lime iron
#

I'm new in Unity and I followed his tutorial on the typing game.
I wanted to implement a scoring system but can't figure out on how to do it code-wise. I wanted the score to increment after destroying the word, can somebody help me out?

#
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class wordDisplay : MonoBehaviour
{    
    public Text text;    
    public AddScore score;    
    public void setWord(string word)
    {
        text.text = word;
    }

    public void removeLetter()
    {
        text.text = text.text.Remove(0, 1);
        text.color = Color.red;
    }

    public void removeWord()
    {
        Destroy(gameObject);
        //add +1 to score here
    }
}
#

^this is my WordDisplay.cs

vagrant geyser
#

Have you tried google?

lime iron
#

I made a ScoreManager script and referenced that inside the WordDisplay script but it cannot find the script because it's in a prefab