Hello folks !
Today I am having a weird bug which could really use your help. I am coding an inventory system which is inside a component. At first I made it inside the character controller, and it worked all fine but decided to do some refactorisation.
Here is the problem, I have 3 TArray inside my component which get update trough member functions (like, additem, removeitem etc). This is all good, I get log message telling me what the inventory contains etc, no problem.
The thing is, for display reason, I want one of my umg to access these TArray. But I get absolutly nothing. Anybody can tell me what am doing wrong please ?
The c++ code in public :
public:
/** Return the tapes by reference*/
UFUNCTION(BlueprintCallable, Category = "Inventory")
void GetInventory(TArray<int32>& inIDs, TArray<int32>& inCounts,TArray<FName>& inTapes) const
{
inTapes = TapeIDs;
inIDs = IDs;
inCounts = Counts;
}
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
TArray<int32> IDs;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
TArray<int32> Counts;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
TArray<FName> TapeIDs;
So this gives us this once in blueprint :
But I don’t get any value out of this.
Does anyone have an idea why ?
Thanks a bunch !!!