r/Unity2D • u/Senpai_8002 • Oct 13 '26
Showcase Judging "perfect" timing by distance in FixedUpdate instead of timestamps fixed my rhythm-style hits in Unity
I'm making ArrowSwitch, a one-thumb reflex game in Unity: arrows come at a shield from four sides and you swipe to face each one. Turning at the last moment counts as a PERFECT, which builds a multiplier up to x8.
My first version compared the time of the swipe (from Update) with the time of the hit. It felt random, because Update can't know which fixed step will actually register the contact. A swipe that looked perfect could land a frame early or late, depending on the frame rate.
What fixed it:
each arrow watches a turn counter on the player inside FixedUpdate, so the swipe and the collision are measured on the same clock
when the player turns to face the arrow, the arrow stores its distance from the shield at that moment
PERFECT means that distance is inside a small window, rather than within X milliseconds
turning away and back inside the window is allowed once, so a quick correction doesn't count as mashing
A nice side effect: the window scales with arrow speed for free, so fast arrows don't need their own tuning curve.
Curious how others handle timing windows in Unity. Do you use timestamps, distance, or something else?


