Hi NilsonLima,
I actually found the solution. I started fiddling around with the Observer pattern but the solution is much easier:
I have a variable “ConeCounter” which I update on each event when my character overlaps a cone. In that overlap method I just call your code:
if (locTextControl != nullptr) {
locTextControl->SetText(FText::FromString(FString::FromInt(this->GetConeCount())));
}
on the last part I just call “GetConeCount()” which returns the value of my variable “ConeCounter”.
Thanks again - it works perfectly
Kind regards, Peter