Need help equating the values of variables between objects,Need help equating values between objects

I am making a Tic Tac Toe game and have 2 game objects.
A “Square” class that is attached to a Box Collider that detects when it’s clicked so that it may spawn a symbol of the player who clicked it. It also has the row number, the column number and the index of the individiual Square in the Grid.

I also have a “Pieces” class that is attached to the Cross and Circle 3d models that are prefabs. In that class I have method that destroys the piece from the board should a player want to destroy a piece.
It also has the row number, column number and index.

The player symbol is instantiated in the GameManager class.

However, I have trouble equating the index/row&column numbers of the Square and the Symbol.
I have tried using
“piece.index = square.index;” (piece being the instanced piece and square being the selected symbol),
“piece.r = square.r;” / “piece.r = square.r;”

Viewing the equating using Debug.Log, I found out that they would equate, but when viewing the spawned object in the hierarchy view the values were wrong.,I am making a Tic Tac Toe game and have 2 game objects.
A “Square” class that is attached to a Box Collider that detects when it’s clicked so that it may spawn a symbol of the player who clicked it. It also has the row number, the column number and the index of the individiual Square in the Grid.

I also have a “Pieces” class that is attached to the Cross and Circle 3d models that are prefabs. In that class I have method that destroys the piece from the board should a player want to destroy a piece.
It also has the row number, column number and index.

The player symbol is instantiated in the GameManager class.

However, I have trouble equating the index/row&column numbers of the Square and the Symbol.
I have tried using
“piece.index = square.index;” (piece being the instanced piece and square being the selected symbol),
“piece.r = square.r;” / “piece.r = square.r;”

Viewing the equating using Debug.Log, I found out that they would equate, but when viewing the spawned object in the hierarchy view the values were wrong.

How do I close the question, I figured it out.
I needed to create a new Pieces variable and instantiate on it:

instantiatedP = Instantiate(piece, other.gameObject.transform.position, Quaternion.identity);

And assign the index of the square on it:

instantiatedP.index = other.index;