I have a problem with mouse click (left or right).
I take an example from the sample “Puzzle”.
One different is that I need capture mouse click from Pawn (witch is connected to PlayerController) no matter what was clicked.
(In sample puzzle blocks are “clickable” by its geometry, but in my idea there is no “geometry”).
I want capture click on screen and create object in this position, but I stuck at capture left click, I can get mouse coordinates from Pawn but not the click event. Position I’m getting form Pawn::Tick function.
[UPDATE]
Im using this->OnClicked.AddDynamic(this, &ATouchTestPawn::MouseClick) from Pawn constructor.
Im binding InputComponent->BindAction("TriggerClick", EInputEvent::IE_Pressed, this, &ATouchTestPawn::TriggerClick) from Pawn::SetupPlayerInputComponent but delegate is not called.
Have you tied your “TriggerClick” action to the left mouse button?
You can do this in the editor in the Project Settings window. Under Engine->Input, there’s a Bindings panel.
You can also do this in code by collecting the UInputSettings object and adding an AxisMapping or ActionMapping (for a click event you would use ActionMapping).