Problem:
I’ve got the following BlueprintNativeEvent:
// When the game starts, this method loads the inventory widget with the current inventory items
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Custom")
void LoadInventoryIntoWidget(TArray<AInventoryItemActor*> InventoryItems);
virtual void LoadInventoryIntoWidget_Implementation(TArray<AInventoryItemActor*> InventoryItems);
And here is the implementation:
void UInventoryUserWidget::LoadInventoryIntoWidget_Implementation(TArray<AInventoryItemActor*> InventoryItems)
{
}
I’m getting the following error when i compile:
...\InventoryUserWidget.gen.cpp(42) : error C2511: 'void UInventoryUserWidget::LoadInventoryIntoWidget(const TArray<AInventoryItemActor
*,FDefaultAllocator> &)': overloaded member function not found in 'UInventoryUserWidget'
If i make the the method take a TArray reference instead, the code compiles but the event is not visible within the editor.
Context:
I need to insert previously picked up inventory items into my inventory widget when the game loads. I am attempting to create a blueprintnativeevent that i can add c++ into while at the same time, implement the visual aspects of the widget through Blueprint.
Where am i going wrong?
Is it even possible to pass blueprint a TArray for an event?
Additional info:
Here is an example of a BlueprintNativeEvent that does work:
header definition:
// When the game starts, this method loads the inventory widget with the current inventory items
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Custom")
void LoadInventoryIntoWidget(UInventory* Inventory);
virtual void LoadInventoryIntoWidget_Implementation(UInventory* Inventory);
cpp declaration:
void UInventoryUserWidget::LoadInventoryIntoWidget_Implementation(UInventory* Inventory)
{
}
so it seems to be a specific problem with TArray