"multiplayer.get_unique_id" is null

Godot Version



I hooked up a custom callable to multiplayer on server connected like so:

Then in the callable, I’m trying to get player ID by doing multiplayer.get_unique_id(), but it’s giving me this error:

cannot call method 'get_unique_id' on a null value

Here’s the full callable function:

# Do something when 2 peers has been connected successfully leading to a server_connected emission
func on_server_connected():
	# Send players information with an RPC function when peers are connected
	send_player_information.rpc_id(1, multiplayer.get_unique_id(), "test_username")

Anyone know why it’s doing that?