Why does blueprint function has duplicate outer/ target?

I have a function I made in code that requires an UObject* outer. When I call this method through blueprints I end up with a “target” and an “outer” input. Is this a problem? Clearly I only need one, but I don’t want to remove it from the c++ method because it would be needed there, but in blueprints it already has a target so I could just use that.

Hey Thumper-

Can you provide the declaration and definition for the function you’re using for clarification? In code I have the function

UFUNCTION(BlueprintCallable, Category = Test)
void Something(UObject* Things);

which gives me this node in blueprints

111266-uobjectnode.png

Are these the two inputs you’re referring to or is your function setup differently?

Yeah the image you posted is correct, that is what I’m describing. Basically target and things are the same object in my example. Perhaps this is just a one off situation? I’m calling a method from an object reference in my blueprint (target), but that method needs an “UObject*” in code, and that object is also the same one that houses the method I’m calling. In code “this” is what I use to pass that memory location along.

Can you post screenshots of your blueprint and code setups? In the case of the example I provided, the function was added in my custom Actor class and the blueprint (MyActorBP) is a child of this class so the Target of ‘self’ is a reference to the blueprint instance making this call. ‘Things’ on the other hand gives me a drop down where I can set any available UObject. If I’m understanding your case correctly, you’ve set the dropdown for Things to MyActorBP.

The “Target” in Blueprints is the calling object the method you are invoking resides within.

If, for example, you were in your Pawn blueprint, and were invoking a method found within one of the Pawn’s component objects, you would attach the component object holding the method you are invoking to the “Target” input.

When “Target” is “self”, that means the method is a member of the blueprint you are currently editing.

Pins below the “Target” are the actual arguments being passed to the method.

If you look underneath the method name within the node, you’ll see the italicized text saying “Target is My Actor”; this is telling you what class your target has to be. Methods of the same name that exist in multiple classes distinguish themselves with this marking. Say you have a Pawn class and a Vehicle class, both with the method “GetHitPoints”, you can visually distinguish between which node you have in your graph by the “Target is…” text.

He says he wanted a “UObject* outer” and the “Things” dropdown should include any available UObject. The function declaration you posted reflects that, and he says the behavior seems correct.

I think he just needed clarification on what the “Target” pin is, and why it appears on the BP node, but isn’t mentioned in his C++ function. This might be something for the UI guys to look at, because it is confusing that the calling object Target looks like a passed argument.

In this instance, he’s passing the calling object a reference to itself as the “Things” argument, and the “Target” reference is always a reference to the calling object, so they are the same here. In other instances he won’t be passing it a reference to itself as the “Things” argument, so they’ll be different then but both still necessary within BP.

My answer below tries to clarify this.