Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

398
Views
Is there a more performant way to detect infrequently used input than Update()?

For example, while debugging I often have an input that allows me to reset the current scene. But, I don't use this so often, so maybe checking every frame in Update() is unnecessary?

I'm aware of InvokeRepeating(). But if I'm checking for GetButtonDown(), won't I need to press the button on the exact frame the invoked method is called?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Calling the input method in every frame isn't very slow. But you could check the input every x seconds and store the result in some class variable and use this variable for input detection. Expect some input latency with this method. The better approach in my opinion is to use the new input system:

Unity's new input system

Some tutorial for setting up this system

With this input system, you can create your own InputAction and subscribe to some event of it. An example would be:

new PlayerInput().Gameplay.Shoot.performed += OnShoot;

The PlayerInput class was generated by unity according to my settings in the editor: My Player input

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!