# Is there a way to use Blueprint Function Libraries or an equivelent feature for non-actor blueprints?

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-use-blueprint-function-libraries-or-an-equivelent-feature-for-non-actor-blueprints/878180>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [April 8, 2023, 11:29am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-use-blueprint-function-libraries-or-an-equivelent-feature-for-non-actor-blueprints/878180 "2023-04-08T11:29:28Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![UnrealEverything](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealEverything](https://forums.unrealengine.com/u/UnrealEverything)\
**Post date:** [April 8, 2023, 8:27pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-use-blueprint-function-libraries-or-an-equivelent-feature-for-non-actor-blueprints/878180/4 "2023-04-08T20:27:14Z")

</div>

The following may not be entirely accurate anymore since its been a while I look into this. From what I remember function libraries need a “World Context” object (hidden function input), essentially any `UObject` that implements `GetWorld`. Actors, ActorComponents and a few other classes implement `GetWorld` accordingly so these can use the function library functions. All classes that directly inherit from `UObject` have the default implementation of `GetWorld` (following the outer-chain). However this default implementation is not considered “valid” because the class does not explicitly override `GetWorld` resulting in functions requiring a “World Context” object not being callable.

There are two solutions I’m aware of (unfortunately both involve some native code):

- either create a C++ class derived from UObject where you implement `GetWorld` in a valid way. You can find a couple of examples for this if you look at existing `GetWorld` implementations from the engine itself. This will make the function library functions callable again in classes inheriting this new class. For some reason the “World Context” object pin will be visible and must be connected manually though (unlike Actors, Components, etc.). Using a `Self` node is sufficient for that though.
- create an empty C++ class derived from UObject and add `meta=(ShowWorldContextPin)` in the `UCLASS(...)` macro. The function library functions should be callable again for classes derived from this new class. And as the name of the metadata suggests the “World Context” object pin will also be visible here and must be connected manually. Since the object itself may or may not have a valid way to `GetWorld` (depending on the outer) you need to decide whether you can pass `Self` or another object as the “World Context”

---

_[View the full topic](https://forums.unrealengine.com/t/is-there-a-way-to-use-blueprint-function-libraries-or-an-equivelent-feature-for-non-actor-blueprints/878180)._
