Please give example to using Swizzle modifier in enhanced input component

When you want to flip the axis of input, like WASD keys.
The first person example swizzles the WS (up/down) axes, but not the SD (left/right) axes, for example.

In the example, the input is essentially passed to the Move Action as a 2DVector like (x, y). If you were to ignore swizzle, you’d be sending the value of WS as the first/x axis, like (WS, 0), which would be problematic when you have to deal with AD’s input in the form of (AD, 0), too.
With it, you’re sending the values of the y-axis (WS) as (0, y), which, together with the values of the x-axis (AD), becomes (x, y).

9 Likes