- Home /
It is not updated per second
hi not much English but I will explain:
I'm doing a "game" in which I need to click to increase the number for example: 0 + click = 10 20 30 per second ...
The problem is that when you click add the second + x amount and what I want is to add x amount per second.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public float counterTime;
public Text textTime;
public float money;
public void Update () {
counterTime += Time.deltaTime;
textTime.text = "" + (int)counterTime + "";
}
public void SubirVideo () {
money = money + 5 + counterTime;
}
}
I tried to translate the code into English for you to understand, THANKS.
First of all there is no class, you may be deleted unnecessary part of codes while showing it, if so please specify it.
Secondly i didnt understand what are you trying to do from your explanation but from your code;
you are incrementing your counterTime with 1 every second,
And adding money with itself and 5 and the counterTime amount.
In your explanation you spoke of a clicking system but there is no clicking at your script nor a Void GUI. If you can share that part of your code with us i may be able to help you.