+1 vote

I'm basically using a modified version of games from scratch networking tutorial

In my game when the Game scene instances both the players, I set their location to different position2D nodes. At the start of the game they spawn at the right spot, but then the client player instantly jumps to the host player position. I copied the tutorial and recreated the issue by adding

thisPlayer.position = $player1.position
otherPlayer.position = $player2.position

to Game.gd, $player1 and $player2 being their respective position2d nodes

I'm pretty sure the problem is caused by the setPosition() function under Player.gd, but I can't figure out how to fix it or how to sync the player positions using an alternative method. Anyone have any ideas?

*Only the bottom 3 scripts at the link (Lobby.gd, Game.gd, Player.gd) are being used
**Screen capture wasn't able to record client player jumping up to host position, I guess it happened too quickly. But in real time I did see it blink from the bottom position node up to the top one

in Engine by (100 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.