Hi everyone!
I have WCharacter derived from ACharacter and in constructor I subscribe for BeginCursorOver event using such syntax:
AWCharacter::AWCharacter()
:Super()
{
PrimaryActorTick.bCanEverTick = true;
OnBeginCursorOver.AddDynamic(this, &AWCharacter::CursorOver);
OnEndCursorOver.AddDynamic(this, &AWCharacter::CursorOut);
}
...
void AWCharacter::CursorOver()
{
if(GEngine)
{
GEngine->AddOnScreenDebugMessage(1, 5.f, FColor::Green, TEXT("Cursor Over"));
}
}
void AWCharacter::CursorOut()
{
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(1, 5.f, FColor::Green, TEXT("Cursor Out"));
}
}
Then i derive few Blueprints with meshes and capsules from WCharacter and place them on the stage - nothing is happen when I hover them with mouse during the game. From the other side - if i implement ActorBeginCursorOver through the blueprints visual scripting for each character like that
everything works just fine. I suppose i missed something in code.
P.S. player controller has mouse over events enabled