# Unity Photon multiplayer :: check distance between two players

How to get distance between two player in a photon multiplayer game. Condition is both the player is moving. I have tried something like this, in my player control script:

if (photonView.isMine)
pos1 = rigidBody.position;
else
pos2 = rigidBody.position;
Distance= Vector3.Distance(pos1-pos2)