The assignment is to name different types of variables and have them print in GUI text on screen. I can only get the last one to show up. I have tried various different variations but am getting nowhere.
I am running around in circles on this project. I have read and reread the text and am still having trouble. I have looked at tutorials and not having luck. Here is what I have so far:
using UnityEngine;
using System.collections;
public class LearningScript : MonoBehaviour {
public int number1 = 2;
public float number2 = 4.7f;
public string someWords = "Now is the time";
public bool checkThisOut = true;
public GUIText outputText;
void Start (){
}
void Update(){
if (Input.GetKeyUp (KeyCodeReturn))
ViewVariables ();
}
void ViewVariables(){
outputText.text = "" + number1 + number2 + someWords + checkThisOut;
}
}
I have tried using seperate outputText.text commands for each variable and it just stores the value for the last variable. When I do as in the example above, it does list them all, but in one line with no spaces. Will you point me in the right direction please?