Hi everybody, I’m beginner in Unity. I’m trying to write a script (c#) that create a list of Text (for a highscore board), but the instantiated Text are not visible. Here is my script :
public Text m_LeaderBoardName;
[...]
List<ScoreEntry> scores = m_LeaderBoard.GetHighScores();
for(int i = 0; i < scores.Count; i++)
{
Vector3 offset = new Vector3(0, i * 20, 0);
Text LBName = (Text)Instantiate(m_LeaderBoardName, m_LeaderBoardName.transform.position, Quaternion.identity);
LBName.transform.position += offset;
LBName.text = scores[i].m_Name;
}
where m_LeaderBoardName is a Text on my gameobject hierarchy. The Texts are effectively instantiated, with pertinent position and text content, but not visible. What am I do wrong ? Feel free to asks me for any precision. Thanks.