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 don’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 don’t know what to do else except if i’ll start to redo all project from very beginning…
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 don’t
know what to do else except if i’ll
start to redo all project from very
Without seeing the project, this could be any number of things.
- Most likely need to set Enable Click Events to true in your player controller. Try this:
- Mouse Interface | Unreal Engine Documentation
- or this:
- Mouse Control Setup | Unreal Engine Documentation
- 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.
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 don’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.
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.