So as everyone knows you can input multiple variables into some functions in the editor.
Such as the Destroy Actor node, which can take multiple actor inputs.
I have not found a way natively to create such a function with Blueprint, even if the function does exactly what the original node does or simply bypasses the reference.
Here is the difference between DestroyActor and your Function Test:
DestroyActor is a function with only the ‘Target’ parameter dictacting which actor is calling the function where as your Function Test is a function that has the same ‘Target’ parameter as the DestroyActor, but also is taking another parameter called Target.
If you were to get multiple ‘self’ references in the Factor Crane BP class, you would be able to plug multiple of them into the ‘Target’(self) parameter because you are saying that all of these references can call this function; but the second ‘Target’ is a single input parameter which can only allow for one object to be passed.
The function ‘test’ takes no actual input parameters, just a ‘self’ target parameter so it knows which object(s) are calling it. The function “Test 2” is an identical function, but takes an additional Actor parameter. As you can see, ‘test’ is able to take in multiple parameters of ‘self’, meaning BP_HeroCharacter_Preview and “Test 2” can also take multiple of the same self references in its primary ‘self’ Target parameter, but can only take one in the second input parameter ‘Target’. The same idea is displayed when plugging in an array variable of type BP_HeroCharacter_Preview.
In the example you provided, you would be able to plug Actor 01, 02, and 03 into the Target (self) parameter of the Function Test as long as they are of type Factory Crane.
Thank you for your detailed response! Very helpful.
However my question was more related to How i can mimick this functionality in a custom Function or for a Function Library Function.
Now that I have this additional knowledge of how this works ( thank you again btw ), I can ask this;
Do you know of any way to mimick the “Target(self)” Input as a secondary or primary input in a function, or get the “Target(self)” input inside a function.
I want to create a Function inside a Function Library primarily that can be run on different actors and run the same function, but allow for multiple Inputs like you explained.
( For example )
Say in this function i print “Bye World” and then Destroy the Input Actor, how can I get this to run on Multiple Inputs like in the Destroy Actor Function, so as the Input can take multiple inputs like the “Target(self)” can.
I do not know of any way to mimick the multiple input functionality of the target (self) parameter of a function call because again, Destroy Actor doesn’t do anything unique here. The input (self) is referring to which classes can call said function and here you can have multiple actors call the same function.
Maybe someone else has a better answer here, but I do not think what you are trying to accomplish is possible via a function library because function library functions do not contain a (self) parameter since they do not belong to a class.
The only way I could imagine is to create a function via a base class that all your different actors extend from, and call that function via multiple actors (as long as they extend from the same class containing the function); but this doesn’t sound like it would fit your desired outcome.