Problem with understanding code

Godot Version

GODOT 4.2.1

Question

I can`t understand this code, from this post about use of MultiplyerSynchronizer and MultiplayerSpawner(Multiplayer in Godot 4.0: Scene Replication)

@export var player := 1 :
	set(id):
		player = id
		# Give authority over the player input to the appropriate peer.
		$PlayerInput.set_multiplayer_authority(id)

Can somebody please explain, what is happening here?

When the export variable id is set in the editor, the node PlayerInput below the node you just set the variable in gets a function call to set its related peer id to the entered id

In simpler terms:
When you change the id, the PlayerInput changes waht player it talks to

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.