Hi
I´ve been trying to set up a multiplayer system in a game, and i want to create an ui button for each host that i find. This was my first try:
function ListHosts()
{
if(hostData)
{
for (var i : int = 0; i < hostData.length; i++)
{
var Button = Instantiate(button);
button.Text.Text = hostData*.gameName;*
-
}*
- }*
}
I get following error: “Assets/Scripts/NetworkManagerScript.js(57,32): BCE0019: ‘Text’ is not a member of ‘UnityEngine.GameObject’.”
So how do i access and change the text of my button. Also, the button isn´t visible after i instantiate it. How do i solve this?
Thanks in advance!