Character Select for localcoop

how do i make button node chose Player for selected one and only Enter Level after both players have selected their character? and also put control set depend on which character player chosen

heres my player control setting

class_name PlayerControls
extends Resource

@export var player_index := 0
@export var Move_left := "P1_Move Left"
@export var Move_right := "P1_Move Right"
@export var Fly := "P1_Fly"
@export var Interact := "P1_Interact"
@export var Run := "P1_Run"
 # example of how key look like in player code
	if not is_on_floor(): 
		velocity += get_gravity()  * delta
	states[current_state].call()
	var speed = Input.get_axis(controls.Move_left, controls.Move_right)

	

its changeable from UI
Player index0 = player 1 and index1 = P2

If you are using controllers you could track by InpuEvent’s .device property, split keyboard local multiplayer may be more work.

A Button node may not be the best fit, using a new per-player action “P1_Start” or reusing “P1_Interact” should also be easier to work with.

i also want to make sure for this to work fine with online