Timer

I’m trying to add a score system to my game. Now like last the code work, surprisingly. Except again, its not how i want it to. Now i looked through the unity documentation for timers but it didnt have anything that seemed related to this which i probably did miss something. I used the same code for my Enenmy Spawn which had the timer thing. But Im also using delta time which i think is the problem which delta time i think uses fps if im not wrong. So is there any way to make increase time every second.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ScoreSystem : MonoBehaviour
{
    public float timer;
    public float scoreRate;
    public Text scoreText;
    public int score;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (timer < scoreRate)
        {
            timer = timer + Time.deltaTime;
        }
        else
        {
            score = score + 1;
            scoreText.text = score.ToString();
        }
    }
}

heres the scoresytem if i need to do something here:

You can check Time.time and see if it’s moved sufficiently past a previously recorded value. Time.time increases from the time the game application started playing. Because you use Time.deltaTime, your approach is exactly the same as this, but starting at zero. There’s nothing wrong with that.

If your timer value increases past 1.0f, do whatever you wanted it to do, and then set the timer value back to 0.0f. That will happen once every second.

so what do i to make the score not shoot up super fast. Do i add Time.time?

Just put timer = 0; after this line: scoreText.text = score.ToString();
What is happening is that as soon as your timer has increased up to or beyond the value in scoreRate then every Update tick after that it will run the code in your else and it will increase the score by 1 every tick.
So you want it to be:

if (timer < scoreRate)
        {
            timer = timer + Time.deltaTime;
        }
        else
        {
            score = score + 1;
            scoreText.text = score.ToString();
            timer = 0;
        }

ahh yes thank you