Real newbie here. The title says it all. I am coding a simple puzzle game. When you click, some tokens flip, otherwise the computer should be doing nothing. It is currently running at 500 fps, I guess executing the update() even if they are empty. How should I code so that the game only acts when there is user input (a click somewhere, key pressed, etc)?
This means vsync is disabled, either in the graphics/quality settings (or editor game view settings) or the driver is set to force disable vsync. Otherwise fps would match the monitor’s refresh rate (usually between 60 to 144 Hz).
A realtime game engine will always render many frames per second. For Unity this is specified by Application.targetFramerate. You can set it to 30 or maybe even down to 20 but keep in mind this will also affect the input response time and how smooth animations will play.
If you want to make a puzzle game that stays completely dormant between user actions you’d have to use a GUI framework.
Your comment was very useful. I don’t really need it to stay completely dormant, with your guidance I could make it less demanding and it is more than enough, thank you!