I downloaded an asset to help with twitch integration (the asset is called “twitcher”). During testing I used a call that uses a string to join a channel.
TwitchController.JoinRoom("TwitchChannel");
This works and I can join that channel. However, when I try to make it a variable as follows, it doesn’t work.
public void ConnectToTwitchFunc ()
{
channelName = channelName.GetComponent<TextMeshProUGUI>().text;
twitchCommands.GetComponent<TwitchRecieveCommands>().ChangeChannel(channelName);
}
public void ChangeChannel(string channelName)
{
Debug.Log(":" + channelName + ":");
TwitchController.JoinRoom(channelName);
}
I dont understand why it works as a string when I type it manually but doesn’t work when I use a variable.