Can anyone try to help me with my double tap sprint detecting other movement keys?

Current Bug is when I press two different movement keys nearly simultaneously (example: W then A within my double-tap window), the system treats it as a valid double-tap and triggers sprint. I want sprint to only trigger when the same key is pressed twice rapidly—not when different keys are pressed close together.

What I Need is a method to track which specific key was pressed last, so the double-tap validation only passes if the current key matches the previous key. Must work with Enhanced Input and four separate movement keys (W, A, S, D). Constraints

any help or tips would be greatly appreciated

(tryna cook something up with Ai help but its not going too well)

I cooked up a solution assuming you’re using the standard template WASD setup; not likely the cleanest, but it works:

One function to set walk speeds - ‘WASDSets’

Four pure functions to evaluate which direction is double tapped - ‘WCheck’, etc.

Four variables to prevent multiple directions during double tap from working - ‘WCheckPass’, etc.

See video and pictures below.