Mouse click event in Blueprint from a PlayerController in C++

I started with the third person template and I created my own PlayerController.

I activated all mouse events in the PlayerController like this

this->bShowMouseCursor = true;
this->bEnableClickEvents = true;
this->bEnableTouchEvents = true;
this->bEnableMouseOverEvents = true;

Then I created a Blueprint which looks like this

But the mouse event doesn’t seem to work. OnBeginOverlap works if I walk over it with my Character, but if I click on it nothing happens. Also my custom classes are set by default

Do I need to do something else?

Hey maikklein,

It is possible that one of your classes has Block Input set to True, but hard to guess where you may have enabled it by accident though as that should be set to False by default. Most likely culprits would be PlayerController or GameMode, though.

Another possibility is that in the collision for your static mesh, the Visibility channel isn’t set to Block. You can check this on the Components tab of your blueprint by selecting the Static Mesh component from the list and scrolling to the Collision section.

Check out those settings and let us know if neither of them is the source of your problem.

Thanks!

edit: Removed part about checking collision for the static mesh entirely due to your Overlap event working

Thanks, the collision wasn’t set to block all.

Just for reference for UE 4.10, as this lists some suggestions what to do if clicking actors doesn’t work. I had a very similar problem and the OnClicked event on the static mesh was never triggered.

Using an “Event BeginInputTouch” node instead solved my problem.