How to Make Hud button do attack. or solve delays funcitionn

Hello, Please someone help me I’m new on Unreal engine. and im trying to create a rpg for mobile.
so so far i have already created a character with walkrun/jump/attack animations. it also have particles. i have tried a variations of approach but not every thing works. the only thing works was to made a function and use it on the onclick of the buttons. but the problem is it doesnt have a delay funtion unlike the main blueprints.

if i put the attac inside a function there will be no delay so the particle and the animation will not blend smoothly.
any one can know how to solve this?

if you want the widget to call the attack script that you have in the character bp then create a custom event (attack), connect the custom event to the branch node you have, then in the widget call the custom event when the attack button is pressed.

im new at unreal engine so… it would hepl if you can elaborate it…?
Where do i do the custom event and how to i branch it on a node on bp… all answer i find was same as yours… but i hardly understand it… because im new. but thanks for the answer…i really appreciate.

speaking of hard to understand, it hard to decipher what your attempting to say.

as stated above you create a custom event in the character where you attack script is. to create a custom event you need to right click the graph and search for custom event. the you need to connect the custom event you created to the rest of your script. you can attach it to the same place as your current event in the character bp, meaning connect the custom event to the branch node you have.

then in the widget you need to call the custom event in your character when the button is clicked. select the button component, then in the details panel scroll to the bottom and press the green button which says on clicked to create a on clicked event. no drag off the on click event and search for cast to thirdperson character (or whatever your class name is), then drag off the object in pin and search for get player character. this gives you a reference to the character currently possessed by the player. now you can drag off the “as thirdpersoncharacter” pin on the cast and search for the custom event you made earlier, then connect the execution pin (the white one). this will result in when the button widget is pressed the custom event in the character will be fired.

its pretty simple and youve done most of it before with the jump script you have shown. if you need more help though let us know and try to be a bit more clear about what your saying so we can understand.

Thanks I have done it not on events but on funtions… i cant work on event u dont understand how it works when connecting umg to blueprint event. but funtion works fine for now… thanks for your help