Hey, sorry if there is a simple answer to my question, I'm a beginner in unity XD Im using 5.3. I have an InputField in my main menu scene, and in another scene I have a text gameobject which displays the InputField text.. I have added a javascript to my InputField (in my main menu scene):
var username : String;
var inputField : UnityEngine.UI.InputField;
var nameDisplay : UnityEngine.GUIText;
function NameInput () {
username = inputField.text;
nameDisplay.text = username;
inputField.enabled = false;
}
Since my InputField and my Text gameobject are in separate scenes, how do I assign this variable? Thanks, Sam ;)
**PS: What I'm trying to make is a username system similar to agar.io and slither.io where you enter your username in an inputfield in the main menu, and it appears above your player in the game scene.**
↧