im trying to display a texture to the GUI with an array of textures. but for some reason it is giving me a null ref error where im calling the GUI.Draw. the error is on line 9 of the code below. the game object is being destroyed, but then i get the null ref error when it is supposed to put the texture on the screen. the fist element of the array in the zero slot is the letterA. which should be on the screen after the gameObject is destroyed.
public Texture2D[] lettersArray;
if( appleString.Contains("A") hit.transform.gameObject.tag == "Ablock" )
{
Debug.Log ("Raycast on A");
Destroy(hit.transform.gameObject);
GUI.DrawTexture(new Rect(10, 200, 200, 100), lettersArray[0]);
isDestroyed = true;
appleString = appleString.Remove (0,1);
Debug.Log(appleString);
}