How to connect blueprint with widget buttons

Hi there.I am new to unreal engine.Weeks ago i started creating a game for android platform.The real struggle begin when i want to connect my bluprint with widget buttons.I want custom control on the android display.So i make them,but i cant use then on player,cant connect them.Can someone help me with that?Early thanks.

98836-playerblueprint.jpg

i siva,
tu use the buttons of your widget to move your player, you ll need to cast to your pawn blueprint
for this :

  1. use the get player pawn node
  2. drag the output of this node and connect it to a cast to “your character” node
  3. drag the output of the node ad connect to the function you want to trigger

should look like this :

3 days searching and the answer is so easy i need more knowledge.Thank you for the help. :slight_smile:

How do i make that for the movement?

for the movement it might be a little bit more tricky,
what i ll do :
1)create a boolean in your character BP, name it “ismovingforward”
2) create a custom event, you ll name moveforward , and add it a float input for scale
3) connect your custom event to the add forward input
4) on the event tick, add a branch, connect your bool as condition, on true output, connect a call to your custom event
should look like this :

  1. in your widget set your boolean to true on the onclick event

  1. in your widget , create an onrelease event of your button and set the boolean to false using same method as 5
    do the same for every moves you plan to do, creating a bool and custom event for each.

an other way shoul be to bind events to inputs, be if you 're starting learning the engine, you can start with what i just gave you. and learn the “bind” system later.
hope it helps

adjust the get right vector to get more intended results.

you d rather use get owning player pawn thant get player pawn. (if you plan to do a multiplayer game)

2 answers , 2 possibilities :slight_smile:

yeah, thanks for correction :slight_smile:

in fact i didn t me to cerrect you XD.
i thought the post was from SIVA .
sorry for that :slight_smile:

no problem , i am the worst when it comes to “what i plug into object in casting” . i got a lot to learn.

hi i see i can chose form 2 possibilities expose why when i do exactly what you do when i press left on the screen its moving on his own and dont stop.

because it won’t set to false (the bool)

use on release as well and set the bool to fasle the same way he explained.

and yes avoid answering your own question use add comment

something like this

set movintleft to false on release(after cast to player)

Thank you.

how to add the same for moving right
oh i fix that with sequence