C++ Blueprint Function always request a Blueprint Function Library as ref how get rid of that

Like I already said I want to get rid of the target or maybe a workaround

//UPDATE:
I want to use it in a player controller for now.

Sorry for my bad english

My header File:

#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyLibrary.generated.h"

/**
 * 
 */
UCLASS()
class GAMENAME_API UMyLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
	
public:
	UFUNCTION(BlueprintPure, Category = "MyLibrary")
		bool SameNameAs(AActor *actor, UBoxComponent *b);
	
	
};

My cpp File:

#include "GameName.h"
#include "MyLibrary.h"

bool UMyLibrary::SameNameAs(AActor* actor, UBoxComponent* b)
{
	if (actor->GetName().Equals(b->GetName()))
	{
		return true;
	}

	return false;
}

Picture(If the picture isn’t being shown do a right click on it and press “Open in new tab”):

Try changing:

UFUNCTION(BlueprintPure, Category = "MyLibrary")
 bool SameNameAs(AActor *actor, UBoxComponent *b);

to

UFUNCTION(BlueprintCallable, Category = "MyLibrary")
 bool SameNameAs(AActor *actor, UBoxComponent *b);

Didn’t solved it just made it so that I would need an additional exec now.

UFUNCTION(BlueprintPure, Category = “MyLibrary”, meta = (HidePin = “Target”, DefaultToSelf = “Target”))

What about that?

It’s still there

I just though maybe I should set it to static because static methodes are accessable from everywhere and it worked!

From this:

#pragma once
 
 #include "Kismet/BlueprintFunctionLibrary.h"
 #include "MyLibrary.generated.h"
 
 /**
  * 
  */
 UCLASS()
 class GAMENAME_API UMyLibrary : public UBlueprintFunctionLibrary
 {
     GENERATED_BODY()
     
 public:
     UFUNCTION(BlueprintPure, Category = "MyLibrary")
         bool SameNameAs(AActor *actor, UBoxComponent *b);
     
     
 };

To this:

#pragma once
 
 #include "Kismet/BlueprintFunctionLibrary.h"
 #include "MyLibrary.generated.h"
 
 /**
  * 
  */
 UCLASS()
 class GAMENAME_API UMyLibrary : public UBlueprintFunctionLibrary
 {
     GENERATED_BODY()
     
 public:
     UFUNCTION(BlueprintPure, Category = "MyLibrary")
         static bool SameNameAs(AActor *actor, UBoxComponent *b);
     
     
 };

//EDIT: And a big Thank you to

Glad to see you got it working! Sorry I couldn’t be of too much help.