How to synchronize the movement of the ball in online P2P? The ball is created using Physics2

How to synchronize the movement of the ball in online P2P? The ball is created using Physics2.
The game is called volleyball. There are two players who interact with the ball. When I play on one computer, everything is fine, but when using P2P online, the ball on one PC is out of sync with the ball on another PC. The ball on the screens moves in different ways. Players and ball is created using Physics2. P2P online created using this video https://www.youtube.com/watch?v=3cf5Z5l9gvk

Do these balls need to interact with other physics objects or each other? Please provide more information so we can help you :smiley:

1 Like

The game is called volleyball. There are two players who interact with the ball. When I play on one computer, everything is fine, but when using P2P online, the ball on one PC is out of sync with the ball on another PC. The ball on the screens moves in different ways. Players and ball is created using Physics2. P2P online created using this video https://www.youtube.com/watch?v=3cf5Z5l9gvk

My idea would be to have one person be authorative and send the position of the ball and the velocity to the other. So the ball is still simulated but will snap to whatever the authorative person has.

1 Like

Good idea. But I don’t know how to do it. Can you give an example?

I’ve never worked with p2p system and have only researched it so you will have to tell me if you have already set up position syncing. If not, here: P2P - GDevelop documentation