How to pass enum in function?

Neither do I. Unless your nodes aren’t working for some reason, I’d just ignore them. I’ve never had to use them for any of my node work. They’re probably something to deal with the whole delayed construction setup required for registering something with the menu to spawn later. But in your case you should be able to spawn, configure and connect nodes to each other without helper types.

How can I ignore them? “too few arguments” if I exclude it, “, ,” didn’t work, nullptr didn’t work either. :frowning:

I still haven’t gotten the syntax right to even spawn a node. :face_with_spiral_eyes:

I put a request on fiverr “Unreal addon base” if you want to make a quick buck helping me out. :slight_smile:

By not calling any function that requires the binding set?

It’s right there in the function I already pointed you at:

NewNode = NewObject<UEdGraphNode>(ParentGraph, InNodeClass);
check(NewNode != nullptr);
NewNode->CreateNewGuid();

You can replace the template parameter with the direct type you want to spawn instead of using a TSubclassOf param like InNodeClass.
After that just configure the node, you can use most of the rest of that function except the ApplyBindings stuff.

Yeah, no. I’m seriously out this time.

You’re not going to believe this… I had ChatGPT fix my code!
I tried using ChatGPT from scratch with just a prompt, but it ended up using entirely different function calls that created nodes… that were just hollow shells.
So, I gave it the code that I had made that I thought was the closest, and with just 2 fixes it works!
:slight_smile:

UEdGraphNode* UMakeBlueprintNodeBPLibrary::AddNodeToBlueprint3(UBlueprint* Blueprint, FName FunctionName, UClass* Class, FVector Location)
{
if (!Blueprint)
{
// Blueprint is null, handle the error
return nullptr;
}

if (!Class)
{
	// The blueprint class is null, handle the error
	return nullptr;
}

//FName FunctionName = FName(TEXT("CreateBlueprint"));
UFunction* Function = Class->FindFunctionByName(FunctionName);
if (!Function)
{
	// The function does not exist in the blueprint class, handle the error
	UE_LOG(LogTemp, Warning, TEXT("Function Not Found"));
	return nullptr;
}

// Get the Event Graph of the blueprint
UEdGraph* EventGraph = Blueprint->UbergraphPages[0];

// Create a new function node in the Event Graph
UEdGraphNode* NewNode = NewObject<UEdGraphNode>(EventGraph);


UBlueprintFunctionNodeSpawner* FunctionNodeSpawner = UBlueprintFunctionNodeSpawner::Create(Function);
if (FunctionNodeSpawner)
{
	FunctionNodeSpawner->SetFlags(RF_Transactional);
	NewNode = FunctionNodeSpawner->Invoke(EventGraph, IBlueprintNodeBinder::FBindingSet(), FVector2D(Location.X, Location.Y));
	return NewNode;
}

return nullptr;

}