On Keybroad A and D for character turn left and right. But on mobile touch screen, added 3 Buttons - left arrow Button ( move character left 45 degree, right arrow Button (move character right 45 degree)
up arrow is for character to JUMP(this works fine)
Please anyone Help me with left and right button character movement functionality.
In the widget blueprint for the ‘OnClicked’ event for either the left or right arrow, do ‘get player character’, ‘get actor rotation’, ‘break rotator’, pull off of the Z pin and type ‘-’, select ‘float - float’, have it - 90 and pull off that node and type ‘make rot’. Plug into the Z pin from the - node. plug the X and Y directly into the ‘make Rot’ node. pull off the ‘get player character’ and type ‘set actor rotation’. Tie the ‘make rotator’ into the ‘set actor rotation’ node.
Test it.
You may need to put + 90 depending on which button (left or right) you start with. I believe left arrow should be -90 and the right arrow should be +90.