How to properly instance a scene while feeding new parameters?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By PapaSolidus

I’m currently trying to create up to four different nodes of the same instantiated scene. Basically a “player join screen”, where a specific input can join and quit at each consecutive call.

My instance root is PathFollow2D with a sprite.
The current Scene has a Path2D to receive those instances as child nodes.
My InputActions are mapped to 4 different keys, each one calling the same generic node spawn function with a different parameter value. The Node spawns with a color that goes to define the sprite modulation, node name:

func _input(event: InputEvent) → void:
if Input.is_action_just_pressed(“REDclick”):
set_player_in(“RED”)
if Input.is_action_just_pressed(“GREENclick”):
set_player_in(“GREEN”)
if Input.is_action_just_pressed(“BLUEclick”):
set_player_in(“BLUE”)
if Input.is_action_just_pressed(“YELLOWclick”):
set_player_in(“YELLOW”)

func set_player_in(color) -> void:
	if players_in.has(color) == false:
		var neuron := preload("res://Game Elements/Player/Neuron.tscn").instance()
		players_in.append(color)
		player_count += 1
		neuron.set_name(color + "neuron")
		neuron.set_modulate(COLORS[color])
		circuit.add_child(neuron)
		print(players_in)
	else:
		players_in.erase(color)
		player_count -= 1
		circuit.get_node(color + "neuron").queue_free()
		print(players_in)

So far it works, but I’m finding it hard to fine tune initial parameters for the instantiated scene such as its child nodes specific properties.
Before this, I thought It was better just to add the child instance and call a method inside its own script to set all its parameters at the moment of initiation of the node. That was not working, so I resorted to the code I now paste here.

What would be the best logic to implement this?