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