How to create a clickable widget than can toggle between running and walking

I’m working on a top down game and I would like to be able to toggle between running and walking by clicking a widget that is on the screen. I would think it isnt much different than using left shift to run when pressed. But I’m unsure.

In your HUD, assuming you have a main HUD widget, you could make a public reference to the character type that your main character is and if you create the HUD via the character - you can drag out and set that character variable to a reference to self OR if you create the HUD else where you could Grab player controller > Get controlled pawn > Cast to your character class and then toggle the reference that way. If you dont know how to create a widget, you create the widget class first, in a blueprint go “Create widget from class” then “add to viewport” and the create widget from class node acts as a variable you can store as well

in your button widget for run walk - scroll down to OnClick in the designer tab with the button selected and then create the function using the green plus. Then in that function drag off the character reference and press Get. Then its just as simple as either A) setting the speed or B) calling the run / walk toggles on your character.

If you’re using one button for walk run you can go next to the text or whatever you’re using to differentiate - even color - and press create binding and you can make a boolean variable on the HUD that triggers the return variable that sets the image / color / text that differentiates between the two and then use this bool in the OnClick function to determine which event or function you’re firing in the character class