UFunction, TArray wildcard input?
I currently have this:
But it won't work for things like an array of FTransform. (I've also tried TArray<UStruct*>.) UFunctions don't seem to like templates so I'm not sure how to achieve this here.
Essentially, I want something like the ADD function which will take an array of anything. How can I
Sorry to hear about the error, but please note, that in the described situation (https://forums.unrealengine.com/showthread.php?56537-Tutorial-How-to-accept-wildcard-structs-in-your-UFUNCTIONs&p=206131#post206131), array isn't being connected directly to Any Struct pin, since this is done for the appropriate struct.
Hope this was helpful!
answered May 07 '15 at 07:51 AM
Please note, that support of templates in function arguments is quite limited now. Thus, this behavior should be handled at the node level. There is a wildcard pin type UEdGraphSchema::PC_Wildcard, which can be used to provide template-like functionality for array functions. When something is connected to a wildcard slot, the appropriate type is set for the rest of the wildcard dependent pins.
It is possible to make a custom subclass of UK2Node_CallFunction, and then allocate a wildcard parameter. In NotifyPinConnectionListChanged() function, you can determine if the pin that was connected was a wildcard and search for an UFunction for appropriate type, and then call UK2Node_SetFromFunction. This way, template-like behavior can be implemented.
However, there is also a way to receive wildcard parameters (USTRUCTs) without creating custom nodes. If you like to learn more about it, please go here:
Hope this was helpful! Have a great day!
answered May 06 '15 at 07:48 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here