photon players position

hi guys im trying to create a radar for my photon network game, the thing is that i need to get the position of every player’s object in the room,

does it have any way to get all players position?

thanks in advance


As long as you’re scripts properly sync player positions then this topic has a simple local-side solution.

GameObject[] players;
Void Start(){
IEnumerable getPlayers(){
While (true){
players = GameObject.FindObjectsWithTag("Player");
yield return new WaitForSeconds(2f);

Void Update(){
Foreach (GameObject p in players){
If (p != null){
// do something with p's position

Make sure that all player tags are set to “Player.”
The coroutine will update the player gameobjects every 2 seconds to reduce lag.