I have an item class with an OnClicked event added. I want to call a function on the local character that clicked on the item. How do I get that reference to the character?
// In constructor
MeshGround->OnClicked.AddDynamic(this, &ATDSItem::ItemOnClicked);
// In my Item class
void ATDSItem::ItemOnClicked(UPrimitiveComponent* ClickedComponent)
{
// Get reference to character that clicked on item and call function passing reference to this item.
GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green, TEXT("Mouse clicked on item."));
}