So just to make it clear, im not asking how to make an array in C++, I know how to do that. I’m wondering if there is a way to mimic the functionality of the make array node in C++ so you can just make an array and input all the elements right away without having to make a specific variable for it.
I understand that you have to have the types defined, but is there a way to define the type of an array in C++ and immediately after that add two different items to it like you can with the make array?
Only if they both derive from the same class and you’ve defined the array as TArray<MyBaseClass*> - I think you’ll find that MakeArray is bound by that same rule - it will probably use something like AActor* as the BaseClass…
In both Blueprint and C++, all items in an array need to share some base class.
This might be UObject*, or AActor*.
You can put objects into such an array as part of the construction process:
Because the C++ documentation assumes that you know the language and can interpret the list of constructors to do the thing that you want. In this case it’s the constructor with the “Initializer list constructor” description listed in the docs that jwatte is using.