Hi,
I try to learn networking in Unity, I want to make my pong game multiplayer: GitHub - Zeldarck/Pong
I have follow this tutorial to get the basis of networking : Unity Learn
In my pong, I want a player see hiself on the bottom of the screen.
So If I have well understand we have that :
Device 1 : got server and client 1
Device 2 :got client 2
On client 1 and server, we got client 2’s player position at the top and client 1’s player position at bottom.
But on client 2 I want client 2’s player position at bottom and client 1’s player position at top.
I tried to modify a little the tutorial exemple and change the position in the PlayerController, but I see a fantomatic player at the two place.
if (!isLocalPlayer)
{
if (!isServer)
{
Vector3 pos = transform.position;
pos.x *= -1;
pos.y *= -1;
transform.position = pos;
}
return;
}
I will continue to search alone and test further things, but I you have good advice or better approach I am open to.
For exemple I don’t know if command enter by player have to be send to server wich make movement and send back position of ball/objects/players. Or if like in the tutorial, players make move, send them to the server wich send it to other players. For me the first it’s better, but with local interpolation to not wait the server update. But I really don’t know enough and where search first on unity networking to achieve it ![]()
thank you
Zel’