Trying to move custom player pawn along axis left and right using Widget buttons.

Hi, I am new to blueprints. I am trying to move my character left and right along the axis using widget buttons. But can’t for the life of me figure out were to use what nodes.

I have a Widget Blueprint and a Player pawn that is connected to my game mode and plugged in correctly.
Appreciate the advice. Thank you :slight_smile:

move my character left and right along the axis using widget buttons.

The below can be set up much better but, at the most fundamental level, it’s this:

To make it better, have user widgets (each with a Button and a custom Event Dispatcher) output direction.


In a more nuanced setup, you could inject an Enhanced Input action into a possessed pawn directly from the widget.

Hi thank you for posting.

Is it possible to set it up the same way for the other button as well?
Or can I only fire one button using this?

Yes:

This way you can hook up all movement directions to the same event.

Thank you so much :slight_smile:

1 Like
  • a widget with just a button, event dispatcher and an Instance Editable variable:

  • add those custom buttons to the Main UI widget and set their data:

  • bind the dispatchers:

  • the result:

Hope it helps!

Hi
apologies

This wont link to here. I created the button called left and I added in all the functionality above #

You need a:

  • user widget that acts as a button
  • add those user widget buttons to the UI interface
  • add UI interface to the viewport

You are adding custom user widget buttons to the viewport directly instead. You skipped this part:

The UI should have those 2 custom buttons you made, here you can set their data. And add any other UI elements, healthbars and whatnots.


The general idea when working with UMG is to make small modular user widgets out of native elements (buttons, borders, progress bars) and add those to the Main UI which you bring up to the viewport.

Sorry I’m too lost.

I don’t know how to bring a widget with a button by itself over into another widget. Or were i’m setting the functionality.

I’ll just pass for now.

Thank you for your help, it’s much appreciated.

1 Like

You’d have 2 widget in this case:

image

  • wDirectionButton is the custom button with the Event Dispatcher
  • wMainUI is the widget that contains 2x wDirectionButton s

You add them the same way you add any other widget:

I renamed them to LEFT / RIGHT to make it clearer. You then bring up the Main UI to the viewport:

It already contains those 2 buttons.

Hi I got the first part set up.

My custom event however wont link to the ED Send Direction. Says delegate is not compatible with delegate.

Avoid plopping down orphaned nodes, start with dragging a wire first, then search for what is needed, taking advantage of the Context Sensitive nature of the actions menu:

The same goes with plugging the wires into nodes, the order in which you do it will occasionally matter since wildcard (grey) pins will inherit type.


If in doubt, consider attaching a screenshots showing what generates the errors. In case you want to study it up close, here’s a link to the sample project UE5 v5.3.1:

1 Like

Thank you for taking your time.

It’s working :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.