getting the position of player for the minimap to follow

using UnityEngine;
using System.Collections;

public class MapFollow : MonoBehaviour {

[SerializeField] public Transform target;

void Update () 
{
	gameObject.transform.position.z = target.transform.position.z;
	gameObject.transform.position.x = target.transform.position.x;
}

}

This is the error:

Assets/IBN/MapFollow.cs(15,38): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.position’. Consider storing the value in a temporary variable

Assets/IBN/MapFollow.cs(16,38): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.position’. Consider storing the value in a temporary variable

A C# gotcha; create a new Vector3(someX, someY, someZ)

assign gameObject.transform.position to that new Vector3; you can’t do the x= new x, y=new y z=new z stuff in C#