Download

Virtual Joystick/Swipe to emulate Keyboard Presses

Hi There,

I am developing an endless runner game for Android. Currently the A and D keys are set up to turn 90 degrees in a desired direction when hitting a certain OnBeginOverlap box event.

I am having issues though when using the virtual joystick as my character does not turn but instead keeps running forward ( 90 degree turn event not triggered ).

Is there a way the virtual joystick can emulate the A and D keys to trigger this event?

Or is there a way that instead of using the A and D keys I can use the Gamepad Left Joystick - Left and Right to perform the 90 degree turn event in the desired direction?

Here is my A and D key setup

Here is my attempted Gamepad setup ( Incomplete )

Try use default ThirdPersonTemplate

This have full controls, Joystick included to mobile,

Joystick have values between -1 and 1 to left-right and 1 and -1 to up-down,

If you use a ThirdPersonTemplate, you can see a return value to each control, that value is between -1 and 1, to set Scale in AddMovementInput

In your example, OnBeginOverlap you set CanTurn true, when you press A that is fine,
In the ThirdPersonExample you can try this in the default pre-set Joystick.

Regards!