Hi,
In my game the left mouse button click can be catched by the player controller and a pawn like this:
PC code:
void MyPlayerController::OnLeftMouseButtonPressed()
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("OnLeftMouseButtonPressed"), false);
}
pawn code:
void MyPawn::NotifyActorOnClicked(FKey ButtonPressed)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("NotifyActorOnClicked"), false);
}
The PC event is triggered by the PC’s InputComponent through a regular BindAction (OnLeftMouseButtonPressed() is a function of my own creation):
InputComponent->BindAction("LeftMouseButton", IE_Pressed, this, &MyPlayerController::OnLeftMouseButtonPressed);
The pawn event, i don’t know how it works, i’m just overwriting the standard NotifyActorOnClicked from the doc.
Now my problem is that no matter what i do, the NotifyActorOnClicked function is always called before the OnLeftMouseButtonPressed and i would like the opposite.
I tried to increase the priority of the PC’s input component with no success, and don’t know how to lower the NotifyActorOnClicked priority.
The pawn’s InputComponent seem to be a nullptr, and i don’t see any need to create one as obviously the NotifyActorOnClicked is called, so there is something in the pawn that catches the left mouse button click.
Any idea how i can force the PC to catch the left click before the pawn ?
Thanks !
Cedric