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) #
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) #
Smooth virtual input value with delta time. Useful with Touch Region in joystick mode.
- Turn Rate : Speed of movement
Negate (Virtual Input Negate) #
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) #
Invert virtual input axis. X become Y and Y become X.
Curve (Virtual Input Curve) #
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.
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!
Note that bool variable Test is private
But displayed in details panel