score, Update, Fixed Update and screen refresh rate (fps)

Hello, I made my first game and I noticed I made a mistake, when counting the score I was incrementing 1 point for every update call, then I remembered Update depends on frame rate of the device, so it’s kinda not constant. So I thought: solution 1: add 1 point every FixedUpdate so that it is constant, ( but this seems not good practice since it’s said to use only rigidbody stuff on fixedupdate)

solution 2: count the time interval in each update call and add points , but I don’t know exactly how to keep it around 1point per 0.02 sec , maybe do some kind of proportion?

Also, In a simple game that needs instant screen reaction to touch, should I increment fixed update to something lke 60calls/s and limit frame rate of screen to 60 also? or what value should I give to each one? To lessen small delays on touch/screen reaction

You should use Time.deltaTime.

Example code:

void Update () {
    score += 60f * Time.deltaTime;
}

Please don’t hesitate to ask any questions!

Remember, Time.deltaTime is a really small number (more specifically, it is
“The time in seconds it took to complete the last frame.”) For example, it might be 1/60 for 60 FPS.

You can use a float to hold the nextTime and compare in the update function.

float nextTime;
float waitTime= .02f;
int score=0;
void Update(){
    if(Time.time > nextTime ){
        nextTime = Time.time + waitTime;
        score++;
    }
}