# How do I make global static functions exposed to Blueprints?

**URL:** <https://forums.unrealengine.com/t/how-do-i-make-global-static-functions-exposed-to-blueprints/31015>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 26, 2015, 5:42am UTC](https://forums.unrealengine.com/t/how-do-i-make-global-static-functions-exposed-to-blueprints/31015 "2015-05-26T05:42:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_3ece948b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3ece948b](https://forums.unrealengine.com/u/anonymous_user_3ece948b)\
**Post date:** [May 26, 2015, 5:42am UTC](https://forums.unrealengine.com/t/how-do-i-make-global-static-functions-exposed-to-blueprints/31015/1 "2015-05-26T05:42:50Z")

</div>

So I tried creating a custom class based on BP Function Libraries - UBlueprintFunctionLibrary - but no matter what I try, I cannot get my new blueprint class to show up in the editor.

> **[How to Make Global Functions and Structs?](https://forums.unrealengine.com/questions/232577/how-to-make-global-functions-and-structs.html)**
>
> Hi there, So I’ve gone from zero to 60 in the last week in terms of understanding how to create UFunctions, UClasses, UProperties, etc. I’m also new to C++, but pretty comfortable with some other languages so programming is nothing new. However,...

I tried replacing GENERATED\_BODY() with GENERATED\_UCLASS\_BODY() - and using a constructor in in CPP file

- " UavKep2Cart::UavKep2Cart(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) {}"
- but I can’t get it to show up even though it compiles fine.

Am I misunderstanding something - or will this method just not work? I really just would like to be able have a blueprint Function which takes simple inputs and calculates a vector position - and I want that calculation to be possible anywhere in the project - since it will be used for reference frame conversion and a lot of static calculations for energy cost, etc.

Are there any good code examples of ways to create globally available BP functions?

Thanks for any help! 🙂

---

<div class="post-metadata">

**Author:** ![Paradox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paradox](https://forums.unrealengine.com/u/Paradox)\
**Post date:** [May 26, 2015, 6:11am UTC](https://forums.unrealengine.com/t/how-do-i-make-global-static-functions-exposed-to-blueprints/31015/2 "2015-05-26T06:11:00Z")

</div>

Not sure if you accidentally looked over this link(down below), but just in case here it is.  
Can you post a section of the .h and .cpp??

–

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![Zhi\_Kang\_Shao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zhi\_Kang\_Shao](https://forums.unrealengine.com/u/Zhi_Kang_Shao)\
**Post date:** [May 26, 2015, 12:12pm UTC](https://forums.unrealengine.com/t/how-do-i-make-global-static-functions-exposed-to-blueprints/31015/4 "2015-05-26T12:12:14Z")

</div>

I got C++ functions to show up as blueprint nodes by making them static BlueprintCallable functions. Header code:

```auto

UCLASS()
class MYGAME_API UGridLibrary : public UObject
{
	GENERATED_BODY()
	
public:
	// Geometric calculations
	UFUNCTION(BlueprintCallable, BlueprintPure, Category=MyGame)
	static FVector GridToWorld(const FGridTransform& GridPlacement, const int32 X, const int32 Y);
	UFUNCTION(BlueprintCallable, BlueprintPure, Category=MyGame)
	static void WorldToGrid(const FGridTransform& GridPlacement, const FVector WorldPos, int32& X, int32& Y);

};

```

I just realized I’m not inheriting from UBlueprintFunctionLibrary, its probably better if you do. I’m not sure what difference it makes.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3ece948b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3ece948b](https://forums.unrealengine.com/u/anonymous_user_3ece948b)\
**Post date:** [May 26, 2015, 7:15pm UTC](https://forums.unrealengine.com/t/how-do-i-make-global-static-functions-exposed-to-blueprints/31015/5 "2015-05-26T19:15:09Z")

</div>

Aha - finally - declaring it static worked - but I had to start a fresh project to test it. I’d changed so many things trying to get it to work that I corrupted something.

Also, BlueprintPure needs to be turned on as you’ve shown.

Thanks folks!
