- Home /
What is wrong with my Counter Script? (C#)
Hi Guys,
I dont know what is wrong with my counter script. i know how to do it in javascript but every other script in my game is c# and i want them all to connect.
Thank You,
using UnityEngine;
using System.Collections;
public class Counter : MonoBehaviour {
// Use this for initialization
int Counter = 0;
void Update (){
Counter++;
guiText.text = ""+Counter;
}
}
Comment
Answer by whydoidoit · Feb 21, 2014 at 04:46 PM
Try using Counter.ToString() and be sure that there is a GuiText attached to the object.