Lately I was creating some global functions inside of Bluprint Function Library (BPFL) and I've noticed that when I call function inside of another function that is also created in same BPFL, World Context Object Reference input pin will appear on the node. This pin doesn't need to be plugged and all the functions will compile without any errors or even warnings.
I've searched for the answear but I wasn't able to find any. I've found only UE-39873 bug ticket which exacly describes this behavior and pull request 8016 that would fix it but It has been resolved as 'Won't fix' without any reason given.
You can even quickly reproduce it by following these steps:
(UE5.0.3 / Epic Launcher version)
So my question is:
Why does World Context pin appear in this specific case and what is the purpose of using it?
Thanks in advance for any explanation!
This question has been answered on UnrealEngine Forum
Thats nothing you should worry about (if gives you an error just connect it with the world context variable).
But basicly, every function that comes from a function library (not from an actor), needs to have a reference in the world to be executed. That’s why it appears, when you call a function from a class that comes from the the class actor it will assume that the world context is the actor itself, that’s why it not appears in characters and actors, it still there but it just not visible.
And additionally here:
When function libraries need a reference of the world sometimes for some tasks… for example get all actors with some tag…the function need to know the world where those actors are…or a delta time, etc.
There is a way to tell the library function to use the actor that is calling it as world context object so the world context pin does not appears in the blueprint node and is adding the meta WordlContext.