Hey guys,
i am running out of ideas. I just can’t manage to capture a mouse click. So here is the scenario:
- I have a UProceduralMeshComponent as the RootComponent of an AActor class added in my level
- Also i have a UMG widget as the HUD with a simple button
- I was adding a mouse click action entry in my Project settings Input section
- I am binding the action to a function which is never called
- I am starting the game in PIE
Here is some code in my ALevelPlayerController:
void ALevelPlayerController::BeginPlay()
{
Super::BeginPlay();
EnableInput(this);
}
void ALevelPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
bEnableClickEvents = true;
bShowMouseCursor = true;
FInputModeGameAndUI inputMode;
inputMode.SetHideCursorDuringCapture(true);
inputMode.SetLockMouseToViewport(true);
SetInputMode(inputMode);
InputComponent->BindAction("TerrainLeftClicked", IE_Pressed, this, &ALevelPlayerController::OnLeftMouseButtonClicked);
}
void ALevelPlayerController::OnLeftMouseButtonClicked()
{
// There is a lot of code here. Unfortunately it never gets executed :(
}
For some reason the OnLeftMouseButtonClicked fucntion is never called. I was reading a lot of solution suggestions in this forums and the rest of internet. All the suggestions i found i was adding in my code without any success. Any help is highly appreciated.
Cheers
DeKande