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.

godotengine.org | Twitter

0 votes

So basically, I tried making a multiplayer game and followed this tutorial by plug world
https://www.youtube.com/watch?v=fE6GNBkeey8&ab_channel=PlugWorld

Followed it exactly but when I create the server, I could move the character and see players physically spawn but when I join a server. It would spawn the player but no other players can be seen even though on the server side, They would appear right next to each other. What's worse was it doesn't update either so its just static and I cant move said client player either so I ruled out the possibility of it spawning far from the other player. So the client is not only blind and cant see the other player except themselves but are also unable to move. What could the problem be here?

Player code:
var speed = 18000
onready var tween = $Tween
puppet var puppetpos = Vector2(0,0) setget puppetpositionset
puppet var vel = Vector2()
var NAME
func _ready():
pass
func _process(delta: float) -> void:
if is
networkmaster():
var move = Vector2(Input.get
actionstrength("uiright") - Input.getactionstrength("uileft"),Input.getactionstrength("uiup") - Input.getactionstrength("uidown"))
move
andslide((move*speed) * delta)
else:
if not tween.is
active():
moveandslide(vel * speed)
func puppetpositionset(newvalue) -> void:
puppet
pos = newvalue
tween.interpolate
property(self,"globalposition",globalposition, puppetpos, 0.1)
tween.start()
func _on
Networktickratetimeout():
if is
networkmaster():
rset
unreliable("puppetposition", globalposition)

Server related code:

var ClientIP = IP.resolvehostname(str(OS.getenvironment("COMPUTERNAME")),1)
onready var c = $IPADRESS
const Player = preload("res://Player.tscn")
var a = Player.instance()
func _ready():
get
tree().connect("networkpeerconnected",self,"connec")
c.text = ClientIP
func instance
player(id) -> void:
var playerinstance = Global.instancenodeatlocation(Player ,Players, Vector2(randrange(0,100), randrange(0,700)))
playerinstance.name = str(id)
player
instance.setnetworkmaster(id)
print(id)
func onJOINpressed():
if $LineEdit.text != "":
Server.Client
Ip = $LineEdit.text
Server.JoinServer()
func _on
CREATEpressed():
Server.Create
Server()
instanceplayer(gettree().getnetworkuniqueid())
func connec(id) -> void:
print("CONNECTION SUCESSFUL!" + str(id))
instance
player(id)

Godot version 3.4.4
in Engine by (20 points)

Please log in or register to answer this question.

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.