The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

I am doing the a youtube tutorial called "Godot 4 - Online Multiplayer FPS From Scratch" by DevLogLogan. Link: I am trying to create the multiplayer part of it, which requires a function called "multiplayer.getuniqueid()." Only problem is that I keep on getting the unexpected identifier error. I am not sure if it has anything to do with UPnP(Universal Plug and Play). If anyone has any information on the unexpected identifier error, please share. Here is the script of the node that has the error:

extends Node

@onready var main_menu = $CanvasLayer/MainMenu
@onready var address_entry = $CanvasLayer/MainMenu/MarginContainer/VBoxContainer/AddressEntry

const Player = preload("res://player.tscn")
const PORT = 9999
var enet_peer =

func _unhandled_input(event):
    if Input.is_action_just_pressed("quit"):

func _on_host_button_pressed():

    multiplayer.multiplayer_peer = enet_peer


func _on_join_button_pressed():
    pass # Replace with function body.

func add_player(peer_id):
    var player = Player.instantiate() = str(peer_id)
Godot version 4.0
in Engine by (15 points)
edited by

Edited to fix code formatting.

1 Answer

0 votes
Best answer

The immediate problem is with this line of code:


It's not indented properly. Fixing the indention will eliminate the error you mention.

by (22,674 points)
selected by

Thank you so much

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.