[Solved] Assign values to another position [closed]


I believe you want the following:

//You would want to create a custom Player class to store this data as it looks silly here but:
        string[] objectNames = { "player1", "player2", "player3", "player4" };
        int[] objectPositionX = { 5, 10, 15, 20 };
        int[] objectPositionY = { 50, 60, 70, 70 };
        for (int i = 0; i < objectNames.Length; i++)
        {
            //An example of this use would be teleporting a player to another player? Say player 2 to player 4's location.
            if(objectNames[i] == "player2")
            {
                objectPositionX[i] = objectPositionX[3];
                objectPositionY[i] = objectPositionY[3];
            }
        }

        //I'm only taking a stab at what you want as the question was a tad vague. But hope this helps.

solved Assign values to another position [closed]