x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.13
Tags:
more ▼

asked Oct 17 '16 at 03:25 PM in C++ Programming

avatar image

Thumper
966 143 150 390

avatar image Doug E ♦♦ STAFF Oct 17 '16 at 04:33 PM

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

alt text

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

uobjectnode.png (18.4 kB)
avatar image Thumper Oct 17 '16 at 05:48 PM

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.

avatar image Doug E ♦♦ STAFF Oct 17 '16 at 06:43 PM

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.

avatar image GigasightMedia Oct 17 '16 at 07:26 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Oct 17 '16 at 06:32 PM

avatar image

GigasightMedia
1.7k 43 13 61

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question