I defined a private array member in a class like this:
UPROPERTY() TArray<FWeightedQuantity> Resources;
Now I want to expose the arry through a function that returns a reference to the array:
UFUNCTION(BlueprintCallable) TArray<FWeightedQuantity>& GetResources();
So that I can modify the array in blueprints:
However, the array stays unmodified as if a copy was returned by the function rather than a reference.
What is the correct way to do it?
Any help is appreciated