StaticMesh onclicked event doesn't fire when it should

Hi All!

I’ve got stucked with onclicked event not firing for static mesh.

My blueprint setup is:

Player controller: here i spawn actor from class by pressing “F” key. All checks in player controller class in Mouse Interface section are checked. Mouse is visible in viewport.

Spawned Actor: Simple actor blueprint with Scene component in root and attached to it static mesh (Shape_Cube). In blueprint settings i have selected (in Input section) “Auto Receive Input” from “Player 0”. Also i’ve added onClicked event for static mesh and connected it to print string block. Collision settings for static mesh “Block All”.

I tried different ways to make onclicked events fire but failed. The only event i could make fire is ActorBeginCursorOver, but it also firing only when i’m clicking on actor.

This setup working correctly if i’m creating new project. Also it worked before i’ve started custom object collision channels creation. Really 't know when exactly mouse events began broken because i’ve worked on some different functionality and didn’t checked click events for a while. The only difference of new project with my is in created additional Object Collision Channels in Projects settings.

My question is: what things in engine can so dramatically affect click events in project? I’m really 't know what to do else except if i’ll start to redo all project from very beginning…

Thanks.

1 Like

This setup working correctly if i’m
creating new project. Also it worked
before i’ve started custom object
collision channels creation.

First thing would be to identify what’s different about the project that is functioning correctly, and the project that does not have this feature functioning correctly.

My question is: what things in engine
can so dramatically affect click
events in project? I’m really 't
know what to do else except if i’ll
start to redo all project from very
beginning…

Without seeing the project, this could be any number of things.

86095-mouseinterface.png

  1. Most likely need to set Enable Click Events to true in your player controller. Try this:
  2. Content Examples Sample Project for Unreal Engine | Unreal Engine 5.3 Documentation
  3. or this:
  4. Content Examples Sample Project for Unreal Engine | Unreal Engine 5.3 Documentation
  5. If neither of these documents help, it’s difficult to say what the problem could be.

If the above solves your issue, you do not need to read any further:

If the feature works in a new project, then the problem is likely with your project, though. Did you migrate to a new version of UE4 recently and convert the project from say, 4.5 to 4.11? If so, the cause could be a refactoring of code as it relates to blueprint and it would be avoided by updating from 4.5 to 4.6 and fixing whatever issues occur there… and so on.

Without seeing your project though, it’s difficult to say what the issue is for certain.

Hello, dsmith!

Thanks for response.
All from 1-4 steps i’ve done already and double checked that this options are correctly switch on. Only overriding of game mode for level was not implemented but i have my game mode blueprint as default game mode in projects setttings. Anyway i’ve checked overriding it but had no success.

As for migrating problems - this is not my case: I’ve started from my project in 4.10 from very beginning.

Looks like i have to redo all in new project and pay attention on what step event s will break. Will write here when i’ll find the cause.

If you 't mind sharing your project, I wouldn’t mind looking at it for you. If not, I do hope you find the cause of your issue.

I had a similar problem. For me, it turns out that what I did that broke it was to implement my fog of war! Since it’s a layer on top of everything, of course it was blocking the clicks.

1 Like

I hope this answer is solved for everyone.
I know this is an old post but I figured mine with adding my Left Mouse as the event key to make it works.

311509-snipaste-2020-08-27-14-34-29.jpg

1 Like

Thank you so much! I once accidentally deleted this field and for half a day I could not find the reason.

I’m in 5.1 and have the same problem. Checked everything and still no solution. OnClicked worked fine for some time, but along the way something went wrong and I can’t click any objects in the world, only on widgets. Also checked that all widgets are not focusable and have z order 0. Have spent 2 days on this issue and it is annoying as hell.