very simple, float to guitext, dont know whats going on here think the C# fatuige is getting to me.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ClassicGameController : MonoBehaviour
{
public static float EarthLife = 1000;
public GUIText EarthLifeText;
public void update()
{
EarthLifeText.Text : "" + EarthLife; //set LP of Earth.
}
}
2 problems here - one of which is obvious and if the line numbers match up (which is why formatting is important!) then you’d see it was on this line:
EarthLifeText.Text : "" + EarthLife;
:? you mean =, right?
however, it’s not a great idea to do this here - better to do it wherever EarthLife changes - setting it every frame is going to slow things down a little…
the other is your function name - unity automatically calls Update() but not update(). pay attention to the case