I have a blueprint with radial menu where i can set Input for Abilities. But, if i change ability input and then connect another player using CreateLocalPlayer, the radial menu shows Input Prompts only for second player. Let me show you:
The problem
Here i set ability with only one player:
Then, i added second player:
And now there is default binds that came from second player:
When i set the ability input again, it shows also on second player:
But input is firing as standart action for player 2
Here how i open menu in player controller:
And code of this node
UCommonActivatableWidget* UCommonLayersSubsystem::PushWidgetToLayer(FGameplayTag Tag,
TSubclassOf<UCommonActivatableWidget> WidgetClass)
{
auto Layer = Layers.Find(Tag);
if (Layer)
{
auto Widget = Layers[Tag]->AddWidget(WidgetClass);
Layers[Tag]->SetVisibility(ESlateVisibility::Visible);
return Widget;
}
return nullptr;
}
UCommonActivatableWidget* UCommonLayersSubsystem::PushWidgetToLayer_ForPlayer(APlayerController* OwningPlayer,
FGameplayTag Tag, TSubclassOf<UCommonActivatableWidget> WidgetClass)
{
if (!ensure(OwningPlayer) || !ensure(WidgetClass))
{
return nullptr;
}
UCommonActivatableWidget* Widget = PushWidgetToLayer(Tag, WidgetClass);
Widget->SetOwningPlayer(OwningPlayer);
return Widget;
}
Widget event graph:
Gather abilities function
Function to bind keys:
Button Ability Mappings: