Communications between Functions and event graph in a Widget BP question

I am just wondering what the best way is to jump from an event graph on a Widget BP to a function on the same BP and back again to the event graph after the function completed its task.

I played around with just calling an event from the function to the event graph to say the function is done and the information is passed on to the rest of the execution line on the event graph.

However I ran into issues with the event graph not getting all the information from the function so I assume the function didn’t have time to finish its execution and the last part of the execution fired too soon on the event graph.

The way I know this is because I am creating a save game to slot and I noticed that the missing information was not written into the save text file. Its encrypted when you open it in a notepad but you can read the variable names in English. So I saw that the one variable that defines the material name that needs saving out was just not saved out. Just missing text. Loading code works fine. It did work for most of the time but every now and then it would just “forget” to save out the material name variable.

I also had the event not fire at all.

Not sure if I need to use an event dispatcher from the function graph to the event graph or if I can just call a custom event. :slight_smile:

What would you guys say?

Also is it better to collapse a group of nodes on the event graph to a function or is it better to create the nodes in a new function?

Just an output pin on the function? That is the problem? :slight_smile:

You got your monkeys mixed.

Collapsing to function from event graph (is it even possible?) Is a bad idea. Functions = no timeline.
Collapsing to a macro is ok / works and generates a bit of code you can call on multiple times.

Aside from that.
I’m not sure what you are doing, and despite the long text you didn’t really explain the setup.

What calls the widget?
What calls the function within the widget?
is the function Recursive?
yes, then your recursion is wrong.
No? Then you have a bad return node somewhere.

Could the function have a function call within it? Perhaps one that causes the call stack to collapse?

TY I found the problem. I recently started to use the Async save to slot node. It gets slot names confused. I switched back to Save game to slot node and it works 100 percent. It could be just because I dont know how to use the Async node correctly the is litte documetation on it. But all the code is now working. Functions were fine all along. TY everyone for your kind responses.

Think I found the issue. It looks like you cant use the Async node everywhere. For example it doesnt work inside a function. I was not using inside a function but coming out of a funtion directly into it. Probably what the issue is.

Also its more meant to be used in a game instance I think I was trying to use it in a Widget BP event graph.