I´m actually using Update(), but score updates every 20 seconds, is there some other way to update score without using update function?.. i mean… for performance reason…
Thanks.
I´m actually using Update(), but score updates every 20 seconds, is there some other way to update score without using update function?.. i mean… for performance reason…
Thanks.
Use a coroutine, like this
function Start() {
StartCoroutine("UpdateScore");
}
function UpdateScore() {
yield;
while(true) {
//Update score here
yield WaitForSeconds(20);
}
}
Ideally, you should only be updating the score after some change is applied to it.
DreamBlur, after thinking in what you have said… i found you´re right, i will add or subtract when an event of hit is made…
Precursor´s coroutine gave me an idea…
thanks both