This is my code: using UnityEngine;using UnityEngine.UI;using System.Collections;public c - Pastebin.com I don’t know how to format code on here so I used pastebin. I made a game object and attatched this script. Then I have an input field and under On End Edit I added the game object. Using UIController.SetPlayerName works. When I type something in and hit enter then inputText variable equals what was typed. Then I added clicked “+” under On End Edit and added the game object again and tried to use UIController.OnGUI to show the text that the player entered but I get the error “You can only call GUI functions from inside OnGUI” but I have a function called OnGui and it’s inside that function that I’m trying to show the text entered by the player. What’s going wrong and how can I fix this? I’m just trying to have the player enter something, then I show what the player entered on the screen.
I feel like I’m missing something very obvious.