# Blueprint function library is not always accessible

**URL:** <https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509>\
**Category:** Blueprint\
**Tags:** unreal-engine, bug-report, editor, Blueprint, question\
**Created:** [April 26, 2015, 10:34pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509 "2015-04-26T22:34:38Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![zamy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zamy](https://forums.unrealengine.com/u/zamy)\
**Post date:** [April 26, 2015, 10:34pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/1 "2015-04-26T22:34:38Z")

</div>

I’m not sure if this is inteded, anyway i created a blueprint function library, with functions declared like this one:

```
UFUNCTION(BlueprintCallable, Category = Game, meta = (WorldContext = "WorldContextObject"))
static class AImperoCharacter* SpawnUnitFromClass(class UObject* WorldContextObject, TSubclassOf<class AImperoCharacter> UnitClass, const FVector& SpawnLocation, const FRotator& FaceDirection, int32 OwnerNumber);

```

They appears as usually if i’m building a graph in a AActor-derived blueprint, instead they don’t appear even if i disable the context option if the blueprint is an UObject-derived one.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [May 15, 2015, 3:48pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/2 "2015-05-15T15:48:37Z")

</div>

Hi zamy,

Sorry for the delayed response to your post. I did some testing on this and noticed the results that you described. It appears to only happen when using `meta = (WorldContext = "WorldContextObject")`, though. I have submitted a report of my findings to have this investigated further (UE-15683).

---

<div class="post-metadata">

**Author:** ![alk3ovation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alk3ovation](https://forums.unrealengine.com/u/alk3ovation)\
**Post date:** [November 18, 2015, 6:53pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/3 "2015-11-18T18:53:30Z")

</div>

Any update on this? This appears to be the case with Blueprint defined BlueprintFunctionLibraries as well, i.e. I have a BlueprintFunctionLibrary I created in blueprint and another UObject derived blueprint cannot call functions inside of it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [November 20, 2015, 8:57pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/4 "2015-11-20T20:57:53Z")

</div>

Hi alk3ovation,

I checked the status of the ticket I had entered, and it is still open. Unfortunately we do not have any estimate for when it will be resolved. However, I did add the additional information that you provided to the ticket.

---

<div class="post-metadata">

**Author:** ![zamy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zamy](https://forums.unrealengine.com/u/zamy)\
**Post date:** [November 26, 2015, 11:23am UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/5 "2015-11-26T11:23:18Z")

</div>

I solved using Actors blueprints or not using WorldContext.

---

<div class="post-metadata">

**Author:** ![romadoma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@romadoma](https://forums.unrealengine.com/u/romadoma)\
**Post date:** [May 10, 2016, 9:37am UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/6 "2016-05-10T09:37:35Z")

</div>

Still have the same issue - can’t access function libraries from Object-derived blueprints. Engine version 4.12.

---

<div class="post-metadata">

**Author:** ![Dominik\_Peacock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dominik\_Peacock](https://forums.unrealengine.com/u/Dominik_Peacock)\
**Post date:** [May 10, 2016, 1:23pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/7 "2016-05-10T13:23:24Z")

</div>

This should really be fixed by now

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [May 20, 2016, 6:38pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/8 "2016-05-20T18:38:31Z")

</div>

Hi romadoma,

Our test case for this issue was fixed in 4.9. Could you please provide some more information about the issue you are seeing and how we can reproduce it?

---

<div class="post-metadata">

**Author:** ![zamy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zamy](https://forums.unrealengine.com/u/zamy)\
**Post date:** [May 21, 2016, 12:05pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/9 "2016-05-21T12:05:48Z")

</div>

Well, removing the meta now it works.  
But with it, nodes still aren’t showing up.  
Test case:

-create a new BlueprintFunctionLibrary

-create a new function, even empty, like this one:

```
UFUNCTION(BlueprintCallable, Category = "MyGame", meta = (WorldContext = "WorldContextObject"))
	static void SpawnMovementParticle(class UObject* WorldContextObject, FVector Location);

```

-create a new blueprint with UObject as parent

-try to use that function in the blueprint: it shows only if we remove the meta tag

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [May 23, 2016, 6:48pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/10 "2016-05-23T18:48:19Z")

</div>

Hi zamy,

Thanks for the clarification. I narrowed it down to find that it is only occurring when the function takes in a UObject parameter named `WorldContextObject`, in this instance. I have updated the ticket for this issue with the new information.

---

<div class="post-metadata">

**Author:** ![AngelWolf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AngelWolf](https://forums.unrealengine.com/u/AngelWolf)\
**Post date:** [September 10, 2016, 10:57pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/11 "2016-09-10T22:57:04Z")

</div>

How is this resolved? I’m not using C++, so I don’t see anything about a WorldContextObject. How do you make it work with Function Libraries made in the editor?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [September 12, 2016, 2:48pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/12 "2016-09-12T14:48:19Z")

</div>

Hi ,

I was not able to reproduce the issue using a Blueprint Function Library created in the Editor. Do you have any specific examples that do not work for you?

Also, you can check the status of this issue [here](https://issues.unrealengine.com/issue/UE-15683).

---

<div class="post-metadata">

**Author:** ![giffen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@giffen](https://forums.unrealengine.com/u/giffen)\
**Post date:** [September 26, 2016, 6:40pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/13 "2016-09-26T18:40:42Z")

</div>

Could we remove the “meta = (WorldContext = “WorldContextObject”)” from the blueprint library functions? This would address most of my issues.

Bill

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [September 27, 2016, 6:24pm UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/14 "2016-09-27T18:24:04Z")

</div>

Hi giffen,

The behavior that I observed happening here would only occur when a UObject reference was passed to the function using the same name as what was defined in the UFUNCTION’s metadata. This tells the function to automatically use a reference to the World for whatever called the function. If it was an Actor that called the function, this works fine. However, for UObjects there is no guarantee that the calling object is even present in a World, so it won’t work. I dug a little bit deeper into this area and I am starting to think that this is actually intended behavior (the report that I originally submitted is still backlogged, so there may actually be something wrong here).

There are a couple ways that you can get around this, though. Both require that the UObject class where you will be calling the function be a custom code class. The first option is to implement an override for the `GetWorld()` function in your UObject class. With this function implemented, any Blueprint that you make from this base class will assume that you are getting the correct World, and the `World Context Object` pin will be exposed on the node for you to plug into.

The other option is to include `meta = (ShowWorldContextPin)` in the UCLASS specifier list for your UObject class. This will also make the `World Context Object` pin visible for you to plug into.

The first option is preferred, since you can make use of the UObject method `ImplementsGetWorld()` but it does imply that the object is tied to a specific World and has a well-defined way to identify that World. Keep in mind that with both of these options, you are losing the safety net of the Engine’s automatic process for specifying the World Context Object. You are essentially telling the Engine that you know what you are doing and are taking responsibility for making sure it works. In both cases, you must be able to plug a valid World Context Object into the pin in order to be able to compile the Blueprint.

---

<div class="post-metadata">

**Author:** ![pdjek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pdjek](https://forums.unrealengine.com/u/pdjek)\
**Post date:** [March 24, 2020, 11:09am UTC](https://forums.unrealengine.com/t/blueprint-function-library-is-not-always-accessible/316509/15 "2020-03-24T11:09:12Z")

</div>

Hi, sorry for necroing. Implementing GetWorld() in my base worked perfectly fine. But this took way too long to find.

I understand the reasoning behind why this is needed, but would be very nice if it could be added to the documentation somewhere. I couldn’t find it mentioned anywhere. Maybe add a note for this on the WorldContext meta tag description.

/
