Can't call function library's function in macro library?

In UE 4.8, I have written some functions in function library, and some macros in macro library which inherited from UObject, and it worked well, I could get the right function from ‘right click filter menu’ no matter whether ‘context sensitive’ was checked. In UE 4.9, I can’t find the function name from ‘right click filter menu’ any more. Is that no supported?

So, I make a experiment. I move macros to another macro library which inherit from AActor, I get the right function again! I noticed that in UE 4.9, when I call functions that in function library, there’s always a WorldContextObject pin at the last parameter even for the very simple function that not refer to the WorldContextObject. But UE 4.8 do not have this problem. Is this the new restriction or feather in UE 4.9? Can’t I call function in function library from UObject inherited macro library any more?

Another problem is when I call a function that refer to a WorldContextObject, of course in AActor inherited macro library, I get an error when engine cook contents for windows, says:‘this blueprint (self) is not a ‘XXXFunctionLibrary’, therefore ‘Target’ must have a connection.’ For the function that not refer to WorldContextObject, it works well. This problem confuse me that AActor macro library should have a WorldContextObject itself, and the function I called belongs to a function library, does it need a self Target? why it always through the error?

1 Like

Hello,

I’m not sure I fully understand what is happening. Your function library functions are not able to be called in the editor is that correct? How are you setting up your function library and your macro library? If possible please include screenshots of your setup so that I can use them as a guideline to test this issue locally.

Cheers

Hello

For question 1,

Maybe you can make a test as follow steps:

  1. Create a new FunctionLibrary, and add a function ‘TestFunc’ in it

65472-qq截图20151104160527.png

  1. Create a new MacroLibrary, inherit from UObject, and add a macro ‘TestMacro’ in it

  2. Select ‘TestMacro’, click mouse’s right button, in the pop down ‘All Possible Actions’ menu, can you find ‘TestFunc’? I my editor, I can’t find it.

  1. In Step 2, if you create a new MacroLibrary inherit from UActor, and make a test as Step 3, you can find ‘TestFunc’.

so why in step 3 I cannot find ‘TestFunc’?

For question 2,

  1. Create a new function ‘APlusB’ in the FunctionLibrary you just created in previous steps.It just calculate ‘A’ plus ‘B’ and return the result.

65475-qq截图20151104155956.png

  1. Call ‘APlusB’ in ‘TestFunc’ which you created in previous steps.

65476-qq截图20151104160021.png

  1. You can find a ‘WorldContextObject’ pin at the input side even ‘APlusB’ don’t need ‘WorldContextObject’.

Is this normal?

I was able to reproduce both issues that you’ve described. The World Context pin does not appear to affect the function being called and still compiles successfully, however it has been bugged (UE-22910). The Function Library/Macro Library issue was also bugged (UE-22946) for investigation.

Cheers

Thank you!
One more thing is I wonder if the ‘The Function Library/Macro Library’ issue will be fixed in next version(4.10)?

We try to get to each issue as quickly as possible but an exact time frame is unknown.

As this seems to still not be fixed in 4.13, I am going to take your word that it still doesn’t affect function calls. Also, I tried looking up UE-22910 in the issue tracker and it gives me the unknown issue error.

Hey MJLaukala-

UE-22910 is not publicly visible due to sensitive information. The bug report, which is specifically for the World Context pin appearing on nodes, has been closed as fixed in 4.11. If you are seeing the World Context pin on your blueprint nodes, please provide additional information and we will reopen the report as necessary.

I seem to be having a similar issue in 4.21 - I can’t get a function created in my function library from a macro library and my function library nodes have World Context pins all over the place (though not setting seems to make no difference)

This issue exists in 4.22 please fix it.

The issue exists in 4.23.1 too, please fix it.

I actually have a PR for this problem: https://github.com/EpicGames/UnrealEngine/pull/5652

This is absolutely crazy that this isn’t fixed yet - in 4.22 you can’t even call BFL functions from anywhere within UObject derived classes.

What. In the actual. Hell.

This has to be merged… How has it not been done yet…

The issue still exists in 4.26 as well, please fix it.

Problem still exist in 4.27 or do I miss something? Wanted to call a BP Function Library in a Macro Library but it seems not to work.

I am currently having the exact same problem. Absolutely bizarre this hasn’t been fixed yet looking after almost 7 years.

1 Like

Still a problem. Still very annoying. Still a big problem for clean structured code when library functions cannot be called in macro libraries. This leads to duplicate code.
Any solution or feedback from epic games?

This is so ridiculous and the fact the only mention about a potential fix was marked as “won’t fix” is just malice

This is a joke, honestly. Ater all these years

“Won’t fix” without explanation and the docs doesn’t even mention every aspect of BPFL and BPML.
We got 5.3 now PLS EXPLAIN

1 Like