Hey folks. I’ve been hacking away at this for many hours today. Each time I think I’m making progress, I fail. I’ve been learning to code for a few months now, off and on, as time and work permit, but really a lot more lately. I got some help with this script yesterday and it’s working great.
#pragma strict
public var fileContents : TextAsset;
function Start () {
var mydata = fileContents.text.Split(“\n”[0]);
// pick a random number between 1 and 10
var myrandom = Random.Range(1,100000);
GetComponent(TextMesh).text = mydata[myrandom];
}
function Update () {
var mydata = fileContents.text.Split(“\n”[0]);
// pick a random number between 1 and 10
var myrandom = Random.Range(1,100000);
GetComponent(TextMesh).text = mydata[myrandom];
}
Now, I’m wanting to convert mydata[myrandom] to a string.
After I have that as a string, I want to execute this cs script with the new variable:
TextToSpeechManager.SendTextToSpeech(the new string);
I’ve been watching tutorials, scouring the web, answers, the forums, etc. I’ve learned about the order in which Unity compiles, standard assets folder, etc. I would post my errors, but I’ve tried so many things now (unsuccessfully!) that I think I’ve seen all the errors. lol
Thanks in advance for anyone willing to help me out with this.