OnClicked not working in C++(works in bp)

I had a similar problem a while back: Sprite click events not firing - Asset Creation - Epic Developer Community Forums

In my case, I’d been doing extra stuff while setting up the actor I was attempting to click that caused it not to recognize the click events. In the end, all I needed was to remove the extra stuff and keep the click-registration:

OnClicked.AddUniqueDynamic(this, &ATerrainTile::OnClicked_Mouse);

Please also note that you (evidently) need to watch for click events on the actor you are trying to click, not the one the player is controlling.

Another possibility I recall was that a bunch of other answers suggested that not having collision components can cause this sort of issue too. If you’re not sure, you can test by creating a blueprint class that inherits from your C++ class, and adding a (e.g.) Box Collision component using the Add Component button.

83266-boxcollision.png

If neither of those help, we may need additional information to help. More of the code from the actor you are trying to click would probably be most important. The code from the constructor and the BeginPlay method is likely the best place to start.

In any case, please let me know if this helps.