So I’m new to coding and I’m trying to make a mobile app that insults you with old insults and I’m trying to make it pick a random insult from three columns and put them together but I’m having problems in unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ShakespeareanInsultKit : MonoBehaviour
{
public string[ ] columnOne;
public string[ ] columnTwo;
public string[ ] columnThree;
public Text Column1;
public Text Column2;
public Text Column3;
int index;
public void Insult()
{
index1 = Random.Range (0,columnOne.Length);
insult1 = columnOne[index1];
index2 = Random.Range (0, columnTwo.Length);
insult2 = columnTwo[index2];
index3 = Random.Range (0, columnThree.Length);
insult3 = columnThree[index3];
Text CompleteInsult = gameObject.GetComponent();
Column1.text = insult1;
}
}
That’s the code and unity keeps saying that index and insults do not exist any help?