How to make Virtual Joystick button function for buttons?
So I'm trying to make car rotate on button clicks same as it does with joystick. But apparently, I don't know how :'(
Currently I got 2 buttons for each half of screen. How to set up rotation angle depending on time pressed of those buttons and reset it on release?
asked Mar 03 '18 at 02:30 PM in Blueprint Scripting
You can bind on the event "OnClicked" of each button. I will probably do it in this way: When (for example) the left button is clicked, you can start a timer that will increase a float value to a max or to a value you want. In BP you will do: "OnClicked"->SetTimerByFunction (or "SetTimerByFunctionName). This function will have the duty to increase your rotation angle till the button is pressed.
When the button is released, you will "ClearAndInvalidateTimerByHandle" of the function so that your rotation angle will stop increasing.
answered Mar 03 '18 at 02:36 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here