What’s this? #
Virtual Input Modifier a is class that allow you to modify the value of the virtual input. Works like the input modifiers on the Enhanced Input plugin. You’ll be able to invert the axes on a virtual joystick or invert the value returned for example.
Here are the modifiers integrated into Touch Interface Designer in version 2024.1.
Scalar (Virtual Input Scale) #
![](https://www.lostingamestudio.com/wp-content/uploads/2024/04/VirtualInputScalar.png)
Allow you to scale the virtual input value
- Scalar : Scale the raw value by this value (multiplier). Avoid negative values
Smooth (Virtual Input Turn Rate) #
![](https://www.lostingamestudio.com/wp-content/uploads/2024/04/VirtualInputSmooth.png)
Smooth virtual input value with delta time. Useful with Touch Region in joystick mode.
- Turn Rate : Speed of movement
Negate (Virtual Input Negate) #
![](https://www.lostingamestudio.com/wp-content/uploads/2024/04/VirtualInputNegate.png)
Invert positive value (ex: if X=1 and bX == true, so X=-1)
- X : Invert X value
- Y : Invert Y value
Swizzle (Virtual Input Swizzle Axis) #
![](https://www.lostingamestudio.com/wp-content/uploads/2024/04/VirtualInputSwizzle.png)
Invert virtual input axis. X become Y and Y become X.
Curve (Virtual Input Curve) #
![](https://www.lostingamestudio.com/wp-content/uploads/2024/04/VirtualInputCurve.png)
Scale virtual input value by curve.
- Curve : Curve asset you want to use
How to modify value of Virtual Input Event at runtime? #
You can modify all variables that are public. Some modifiers may contain public functions that you can call. To retrieve a modifier on a virtual input, call the following node: Get Virtual Input Modifier by Class. You can then modify the variables you wish. Modifications will take effect at the next tick.
![](https://www.lostingamestudio.com/wp-content/uploads/2024/04/ModifyVirtualInputModifier.png)
Create my own modifier #
You can create your own modifier by creating a class based on the Virtual Input Modifier class. This is best done in C++, but can also be done in blueprint. The disadvantage of blueprint is that private variables are displayed in the details panel.
Override ModifyRaw function and do something!
![](https://www.lostingamestudio.com/wp-content/uploads/2024/04/CustomModifierBlueprint-1024x576.png)
Note that bool variable Test is private
![](https://www.lostingamestudio.com/wp-content/uploads/2024/04/CustomModifierDisplayInconsistency.png)
But displayed in details panel