OnClickEvents used to work until I renamed my C++ class, I deleted the blueprint and made a new one now , it doesn't work and it rarely works when I spam clicks on it like 20 time for it to work once.
this is the event in the actor I am trying to click. Note I only use blueprint to set the mesh or transform and scale
MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComponent"));
MyBoxComponent= CreateDefaultSubobject<UBoxComponent>(TEXT("MyBoxComponent"));
SetRootComponent(MeshComponent);
MyBoxComponent->SetupAttachment(MeshComponent);
OnClicked.AddDynamic(this, &AMyClass::OnClick);
the player controller left mouse click is set to
bShowMouseCursor = true;
bEnableClickEvents = true;
bEnableMouseOverEvents = true;