What’s this? #
Virtual input events are a simple way of extending the functionality of a virtual input. For example, you can add a progress bar and trigger events when the user interacts with the virtual input.
Auto Move #
The joystick can be held in one direction to trigger automatic movement.
- Auto Move Threshold : The minimum value of joystick (vector length) to trigger auto move.
- Auto Move Direction Threshold : The max value tolerated for auto move detection (AngleDelta When Hold). A value of 0.98 seems correct with Fingers. Use a value of 1 for mouse.
- Auto Move Hold Duration : The amount of time in seconds you hold a joystick to one direction before it trigger auto move. A value of 0 disable this feature
- Lock Icon : Image for lock icon when auto move is enabled
Drag to Sprint #
If the user’s finger exceeds the detection zone of the joystick then the system activates the drag to sprint function.
- This feature needs space above the joystick to work properly.
- Pay attention to the placement of the joystick which must be at the bottom of the screen
- Drag to sprint Trigger : The minimum drag length in pixel (Y axis, vertical) to start the sprint.
- Auto Sprint Trigger : The minimum drag length in pixel (Y axis, vertical) to lock input to DragToSprint when finger’s user end touch.
- Drag to sprint Threshold : The max value in X axis (horizontal) tolerated for drag to sprint detection (Length). If the joystick exceeds this value, then the drag to sprint event is not launched. A value of 40 seems correct.
- Enable Auto Sprint : Whether or not auto move should be launched
- Sprint Icon : Icon when drag to sprint is triggered
- Auto Sprint Icon : Auto sprint icon (displayed on joystick)
- Input Action : Input Action to use for sprint
Haptic #
Play haptic feedback
- Force Feedback Effect : Force feedback effect asset you want to use
- Looping : Whether or not effect should loop.
- Ignore Time Dilation : Whether or not effect is affected by time dilation
- Play While Paused : Whether or not effect continue to play when game is paused
- Stop Immediately When Touch Ends : If this option is enabled, the effect stops immediately at the end of the touch, otherwise, the effect stops only when the force feedback effect is completed.
Sound #
Play sound
- Pressed Sound : Sound played when user start touching virtual input.
Create my own Virtual Input Event #
You can create your own virtual input event by creating a class based on the Virtual Input Event 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 Initialize, On Touch Begin, On Touch Move, On Touch End, On Tick.