- Home /
higher frame-rate than update frame-rate
Update frame-rate is related to render, so it cann't be too high or there is no need. For some reason, I want my scripts to run at higher frame-rate, such as faster input, faster network message execution. InvokeRepeating and WaitForSeconds don't work. Maybe FixedUpdate can work? Is there a good way to do this?
Why doesn't InvokeRepeating work? You can specify the interval you want (so long as your hardware can cope). Otherwise I'd just create a separate thread.
I set Update frame-rate 50, InvokeRepeating frame-rate 100. Yes every frame Update runs once, InvokeRepeating runs exactly twice. But the problem is two InvokeRepeating run at the same time. For example, Update runs at 0ms, 20ms, 40ms... InvokeRepeating runs at 0ms, 0ms, 20ms, 20ms... And Even FixedUpdate is the same! I use Time.realtimeSinceStartup records time. Just in case I also use QueryPerformanceFrequency and QueryPerformanceCounter record time, but there is no diffrence. Is there anything I do wrong?
http://forum.unity3d.com/threads/the-truth-about-fixedupdate.231637/ This page explains FixedUpdate. According to my test, InvokeRepeating is the same as FixedUpdate.
Answer by Kiwasi · Mar 11, 2015 at 04:05 AM
If you really need something to run at some defined frequency, you are better off setting up its own thread and implementing a timer using sleep. Pretty much all of Unities built in methods follow the same pattern. Run Update once, then call the methods as many times as it takes to catch up. Then repeat. Its not overly useful for genuine real time applications, like on the fly sound generation.
Your answer
![](https://koobas.hobune.stream/wayback/20220613185700im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
input not working on high framerate 0 Answers
Time.deltaTime does not always correctly display the time difference between 2 frames 1 Answer
Is Update() NOT linked with graphics refresh rate? 3 Answers
How can I prevent Input.GetAxis from sporadically reporting deltas of 0.0? 0 Answers
Replay system for android, need help with precision (framerate problem) 1 Answer