Download

Help making a new blueprint function

Hello everybody.
I’m making a new function usable with blueprints.
I made a new class called “Login” and this is my header file.
Everythings work of before I moved the function SendData to the GameMode File.
The problem is that i need a target when i use this function. I have the login widget and when login button is pressed this function should happen.
What should I do? Thanks



UCLASS()
class TEST_2_API ULogin : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	ATest_2GameMode* Game;
	FSocket* Socket;
	UEngine* UE;

	UFUNCTION(BlueprintCallable, meta = (DisplayName = "SendLoginRequest_BP"), Category = "Login")
		static bool SendLoginRequest_BP(const FString& Username, const FString& Password);

	UFUNCTION(BlueprintImplementableEvent, Category = Login)
		void LoginOk();

	UFUNCTION(BlueprintImplementableEvent, Category = Logim)
		void LoginFailed();
};


and this is the .cpp file



bool ULogin::SendLoginRequest_BP(const FString& Username, const FString& Password)
{
	return Game->SendData(CTS_SEND_LOGIN_REQUEST, Username, Password);
}


And this is the immage of the widget’s graph.

Problem solved