Create a " Make Literal " node

Hi everyone. I’m trying to create a node like the Make literal Unreal have. I know that I can achieve this by using the UFUNCTION macro, but unfortunately, I can’t by how the code is structured. I’m using CreatePin from UEdGraphNode. Any idea how can I get this working? I don’t find a way to access to the interface of the node or any similar solution. Thanks!

Just make a static UFUNCTION. That’s how all the engine ones work, there’s no need to make a special node. See UKismetSystemLibrary for an example.

I know that with UFUNCTION I can achieve this, the problem is that I have my own graph created as well, it’s not like the actor event graph. I’ve tried what you mentioned, but it does not work for me. I do it always with UFUNCTION, but as I’m working with my own graph it does not allow me, it just don’t appear in the node searchbox. That is why I need to deal with the CreatePin node from the UEdGraphNode class. And allowing the UFUNCTION functionality means to redo a lot of code.

I don’t follow. Why wouldn’t this work? No context is required for a static function.



UFUNCTION(BlueprintCallable)
static float MakeAFloat(float SomeInput) { return SomeInput; }