Skip to main content
Discovery icon for Official Unity Discord Discord server

Official Unity Discord

31,210 Online
140,063 Members
# 💻┃code-beginner3 people

timing held button inputs

Triggering actions after holding a button requires timers in Update, coroutines, or async functions rather than relying on Invoke.

  • Precise timing to exactly 0.2 seconds is not feasible, but standard timer patterns should match the rest of the project
  • Async methods, coroutines, or manual timers in Update are preferred over Invoke due to Invoke using magic strings and reflection
  • For held button triggers, an async function or coroutine can wait after the initial press while checking input state
  • Documentation was shared for checking button hold state using the Input System's IsPressed method
Summarized from recent messages, might be inaccurate

More conversations

Talk, Play, &
Hang Out

Find your space to hang out, discuss the latest updates with the party chat, and see who's down to join your next match.
Get App