hi,
how would you check the distance between two players in photon, using vector3.distance. I’m kind off new to multiplayer.
(c#)
hi,
how would you check the distance between two players in photon, using vector3.distance. I’m kind off new to multiplayer.
(c#)
@arain55 Just do like normal Vector3.Distance(player1gameObject.transform.position, player2gameObject.transform.position);
You have to think of networking a little bit differently.
This of it like this: When you run your game each client creates everything on their build. All that is being passed is that data that you want, in this case the transforms of the player position. When receiving data you then apply that data to the player from it’s photon ID.
Example:
Player 2 starts his game, and then creates a instance of player 1 and 2 in his game.
At any time player 1 or 2 could have done a distance check to see how far apart they are, there is little difference between networking and non networking other than the way you handle properties.