Hey Everyone !
I didn’t get any answer on the answerhub with this one, so trying my luck here
My left mouse button can be catched by 3 different assets:
1/ an pawn (APawn) through a NotifyActorOnClicked() callback
2/ the player controller (APlayerController) through its input component
3/ a 3D UMG widget (MyDefaultPawn->UWidgetComponent->UUserWidget) through an interaction widget (MyDefaultPawn->UWidgetInteractionComponent)
I need those three to occur in a specific order and sometimes block the input but don’t know how to do that.
(2) is faily simple, there is an input component so i can set InputComponent->Priority and InputComponent->bBlockInput but it doesn’t seem to have the least effect.
(1) is odd, the pawn has an inputcomponent of its own but it’s not defined and yet NotifyActorOnClicked() is called. I even tried to put an “if (InputCompoent)” in NotifyActorOnClicked() but i never satisfy the condition. So it seems that the pawn respond to the left mouse click without an input component.
(3) is also very mysterious to me, i have no idea how UMG widget interact with inputs (even more mysterious now that the Interaction widget is around). It seems to be depending on the PC’s inputcomponent since i trigger the Interaction Widget using a function bound to the inputcomponent action:
InputComponent->BindAction("LeftMouseButton", IE_Pressed, this, &AYagPlayerController::OnLeftMouseButtonPressed);
-------------
void AYagPlayerController::OnLeftMouseButtonPressed()
{
// click on the UI
ThisPawn->WidgetInteractionComponent->PressPointerKey(EKeys::LeftMouseButton);
// do what PC is supposed to do: draw a selection rectangle (RTS style)
SelectStartRectangle();
}
But this setup doesn’t allow the widget to block the PC.
Anyone around to point me in the right direction to manage my inputs priorities and blockings ?
Thanks !
Cedric