I have a TArray of UObjects, set in the Editor. Each UObject also has a TArray of Uobjects.
I set the variables on the UObjects in the Editor as well as add to the TArray’s.
The blueprint that all this is set on extends from the C++ class extending UObject. There is a pointer to this on a class extending from AAIController.
UPROPERTY(EditAnywhere, Category = "AI")
UIAUtilitySystem* UtilitySystem;
This is set in the Editor also.
At runtime, the controller is instanced and calls a function on the UObject with the TArray. It goes into the function fine, it is a valid instance, but the TArray is not valid.
How do I instanciate the TArray, full of UObjects that have the settings set in the Editor?
This is the top UObject, Init is run on it so it is intanced. I removed variables and functions that don’t apply to this.
UCLASS(Blueprintable)
class CATSNIPER_API UIAUtilitySystem : UObject
{
GENERATED_BODY()
:
void Init(ACatAIController* controller);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
TArray<FIAAction> ActionList;
private:
ACatAIController* MyController;
};
Here is the UObject in the list:
USTRUCT(Blueprintable)
struct FIAAction
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
FActionTypeEnum ActionType;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
TArray<FIAAxis> AxisList;
};
Thank you.