I’ve created BP with c++, but I couldn’t get access to it from any BP, which class is different, because of hidden Target input parameter. It wants the same class, as where I implemented function. Found this question: https://answers.unrealengine.com/questions/49549/can-i-create-a-static-function-which-i-can-access.html
But making class, which is inherited from UObject is the same. It need my class blueprint in target parmaeter.
Function has’nt arguments like target and not using “self”. Why BP need Target self? How to fix it?
Blueprint is tied to same rules and structures as C++ and same as you need to target from which object you want to call a function, same in blueprint you need to point “Target”.
Use “static” as i showed in example
UFUNCTION(BlueprintCallable, Category = "Something")
static void DoSomething(UClass* Something);
“Static” statement is obligation to compiler that function will not use object instance of a class, so in exchange it will let you call that function without need of targeting object and in C++ class becomes more like namespace for that function and in blueprint “target” input dissapers as it is no needed anymore.
And same as i posted there, check UGameplayStatics class in engine source code:
https://github.com/EpicGames/UnrealEngine/blob/4.2/Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h
https://github.com/EpicGames/UnrealEngine/blob/4.2/Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp
It’s full of static functions targeted for blueprint use which doesn’t require “target” input
Oh, but my function needs to return dynamic object!!!