UMG button for vehicle handbrake control?

Can someone help me please…

I am using the Sedan vehicle template and want to be able to control its handbrake via an on-screen UMG button.

I have created my UMG button widget BP and have got it to display on screen by calling it from my Level BP.

My problem is finding the correct nodes to use in the Widget BP’s event graph to make OnPressed (and OnReleased) activate the ‘Set Handbrake Input’ node/s that I want to use (as used in the Sedan BP).

I’m aware that UMG buttons cannot currently be used for axis inputs but can it be used for an action (like handbrake)? If anyone can help I would be very grateful indeed as I’ve spent days trying to figure this out - although I must admit to still being quite a noob with BP scripting :wink:

Hi.

Use this answer to get a reference for your sedan inside the Widget blueprint: https://answers.unrealengine.com/questions/363020/stuck-trying-to-display-a-variable-to-the-players.html
Is the second image, but instead of “ThirdPersonCharacter”, you cast to “Sedan”.

On Your Sedan blueprint, create Two CustomEvents “Handbrake On” Handbrake Off" and connect than to the SetHandbrakeInput nodes.

When you on the button, call from the “Playerdata” variable the event “Handbrake On”, when release “Handbrake Off”.

I hope this help you.

Thanks Tercio - could you explain “call from the Playerdata variable” please.
I have created the two custom events in the Sedan BP and connected them to the SetHandbrakeInput nodes. Next I went to the WidgetBP and added Cast To Sedan to the Event Construct - and then I dragged off the blue pin and promoted it to a variable which I named Playerdata - as in my screenshot below.
Now I’m a bit lost…

ah, ok I think I made a mistake just now so I deleted the Set and dragged off the blue pin again but this time I found Set PlayerData, which I assume is right. Now how do I call my two custom events from this PlayerData?

aha! so by turning off ‘context sensitive’ I found my two custom events (HandbrakeOn and HandbrakeOff) - now if I can keep focus on the UI and the widget it should be ok…