Hi,
ENGINE: UE5.0.3
I am trying to run a function in c++ when the event OnBeginCursorOver is fired, but although reading many examples from UE4 and a single post about it in UE5, I can’t get it to work myself.
.h file:
UCLASS()
class MyGame_API AMob : public ACharacter
{
…
public:
UFunction()
void MyFunction();
}
.cpp
AMob::AMob()
{
…
FScriptDelegate x;
x.BindUFunction(this, “MyFunction”);
OnBeginCursorOver.Add(x);… …
GetMesh()->OnBeginCursorOver.Add(x);
}AMob::MyFunction()
{
UE_LOG(LogTemp, Warning, TEXT(“WOOOOO IT WORKS!!”));
}
I added function delegates for the OnBeginCursorOver for the SkeletalMesh and for the Actor object, but MyFunction is never executed once.
And I do have “Enable Mouse Over Events” set to true, and I tested that it works for other basic objects when mousing over them. I just want to avoid using blueprints as I prefer c++.
Any help is appreciated.