A
A
Alexander2020-01-03 19:38:07
Unity
Alexander, 2020-01-03 19:38:07

The timer depends on fps. How to do it right?

public int numbers = 0;
public int numbersLim = 200;

    void Update()
    {
        numbers++;

        if (numbers > numbersLim)
        {
                Shot();
                numbers = 0;
        }
    }


The editor has 200 fps, and it shoots once per second, but usually, in Vert games. synchronization limits fps to 60. How to implement the timer correctly so that it does not depend on fps?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2020-01-03
@AlexandrG44

Time.deltaTime

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question