Cant use Pointer for TArray
Im trying to create a TArray pointer to store a link to a const TArray reference outputed by a Reference Skeleton.
Tried putting the "*" inside of the <> and i get the same Error. This is the code for obtaining the data.
asked Feb 12 '16 at 02:56 PM in C++ Programming
TArray* are not a supported UPROPERTY type. The only way to do what you are trying to do is remove the UPROPERTY and do it without that support. It's kind of dangerous though since the object that it is pointing to can be garbage collected and you'd never know until you accessed it and crashed.
answered Feb 12 '16 at 05:30 PM
Blueprints don't support pointers of any type except UObject pointers (because they can only be used in pointers anyway). Because of that UHT don't know what to do with this varable and give you error, so remove BlueprintReadOnly, if that does not work remove UPROPERTY() all together and manually manage that pointer, null it when object it points to is deleted, i recommend you do that anyway because i'm not sure if TArray pointers would work properly in reflection system.
What you trying to do is quite unconventional (and probably not recommended) in UE4, i never seen case of TArray pointer in UE4 (and i seen a lot of UE4 code ;p). Common practice in UE4 for something like that is to create functions with reference argument to interact with forgain array and modify it, like GetAllActorsOfClass for example:
Follow this question
Once you sign in you will be able to subscribe for any updates here