Is there an official or best practice way to cancel opposite input with Enhanced Input?
I mean when using WASD to move around, I want W and S to cancel each other and same for A and D. What happens when I follow the official documentation is that one of the keys has priority when both are held at the same time (it seems to be the lowest one in the list of bindings (highest index)).
I have a functional workaround which is to create a different Input Action to bind to the “Negate” keys, but it just feels wrong and messy.
That’s what I had before that was not working. I just tried it again using the exact same order you have with the same results.
When I hold A and D together, it goes on the right. When I hold W and S together it goes back. If I reorder D before A and S before W it does the opposite.
I see. Yeah the only difference between these solutions is semantic. Yours uses 2 input actions, “positive” (forward/right) and “negative” (backward/left), whereas mine uses the 4 cardinal directions.
Effectively they work the same.
I haven’t dug into the actual distribution of IA_Move enough to know if there is a “1 input action” way to solve this problem, but as it makes no practical difference to me, I think either of the 2 solutions works fine. Certainly well enough for my purposes.